zz-chart
Advanced tools
Comparing version 0.1.0-beta.38 to 0.1.0-beta.39
@@ -25,2 +25,5 @@ import { ScaleOption } from '../types/index.js'; | ||
auto: boolean; | ||
range?: undefined; | ||
} | { | ||
auto: boolean; | ||
range: (_u: import("uplot"), dataMin: number, dataMax: number) => number[]; | ||
@@ -27,0 +30,0 @@ }; |
@@ -12,9 +12,7 @@ import { get, isNumber } from 'lodash'; | ||
render() { | ||
// .. | ||
const opt = this.ctrl.getOption(); | ||
this.option = get(opt, this.name, {}); | ||
this.option = get(this.ctrl.getOption(), this.name, {}); | ||
} | ||
update() { | ||
// .. | ||
this.option = get(this.ctrl.getOption(), this.name); | ||
this.option = get(this.ctrl.getOption(), this.name, {}); | ||
const x = get(this.option, 'x'); | ||
@@ -43,2 +41,5 @@ const y = get(this.option, 'y'); | ||
getXOptions() { | ||
if (!this.option.x) { | ||
return {}; | ||
} | ||
const { max, min } = (this.option.x || {}); | ||
@@ -53,2 +54,7 @@ const maxV = isNumber(max) ? { max } : {}; | ||
getYOptions() { | ||
if (!this.option.y) { | ||
return { | ||
auto: true, | ||
}; | ||
} | ||
const { max, min } = (this.option.y || {}); | ||
@@ -55,0 +61,0 @@ const notAuto = !isNumber(max) && !isNumber(min); |
@@ -0,1 +1,2 @@ | ||
/// <reference types="web" /> | ||
import uPlot from 'uplot'; | ||
@@ -56,2 +57,5 @@ import { Shape } from './index.js'; | ||
}; | ||
focus: { | ||
prox: number; | ||
}; | ||
} & uPlot.Cursor; | ||
@@ -58,0 +62,0 @@ }; |
@@ -36,3 +36,3 @@ import { StyleSheet, css } from 'aphrodite/no-important.js'; | ||
listStyleType: 'none', | ||
padding: 0, | ||
padding: '2px 8px', | ||
display: 'flex', | ||
@@ -139,3 +139,3 @@ alignItems: 'center', | ||
const name = this.handleTemplateString(String(item.name), nameFormatter); | ||
return `<li class="${css(styles['tooltip-list-item'])}"> | ||
return `<li class="${css(styles['tooltip-list-item'])}" style="background: ${item.activated ? this.ctrl.getTheme().colorVar['b-6'] : 'unset'}"> | ||
<span class="${css(symbolStyle.symbol)} ${css(symbolStyle.line)}" style="background: ${item.color};"></span> | ||
@@ -142,0 +142,0 @@ <span class="tooltip-name">${name || NOT_AVAILABLE}</span> |
@@ -57,3 +57,6 @@ import { axesSpace } from './utils.js'; | ||
}; | ||
focus: { | ||
prox: number; | ||
}; | ||
}; | ||
}; |
@@ -17,3 +17,3 @@ import { axesSpace } from './utils.js'; | ||
export const UPLOT_DEFAULT_OPTIONS = { | ||
padding: [0, 0, 0, 0], | ||
padding: [16, 0, 0, 0], | ||
legend: { | ||
@@ -73,7 +73,7 @@ show: false, | ||
}, | ||
// focus: { | ||
// prox: 20, // 鼠标移入点激活 像素激活距离 | ||
// }, | ||
focus: { | ||
prox: 30, // 鼠标移入点激活 像素激活距离 | ||
}, | ||
}, | ||
}; | ||
//# sourceMappingURL=config.js.map |
@@ -32,2 +32,3 @@ import UPlot from 'uplot'; | ||
private recordActive; | ||
activeId: number; | ||
init(): void; | ||
@@ -34,0 +35,0 @@ /** |
@@ -49,2 +49,7 @@ import { merge, mergeWith, omit } from 'lodash'; | ||
], | ||
setSeries: [ | ||
(_u, id) => { | ||
this.activeId = id; | ||
}, | ||
], | ||
ready: [ | ||
@@ -281,7 +286,2 @@ () => { | ||
}, | ||
// setSize: () => { | ||
// const bbox = over.getBoundingClientRect(); | ||
// bLeft = bbox.left; | ||
// bTop = bbox.top; | ||
// }, | ||
syncRect: (_, rect) => (overBbox = rect), | ||
@@ -318,2 +318,3 @@ setCursor: (u) => { | ||
value: curr.values[idx || 0]?.y, | ||
activated: this.activeId === index + 1, | ||
...curr.values[idx || 0], | ||
@@ -320,0 +321,0 @@ }, |
@@ -27,3 +27,4 @@ /// <reference types="react" resolution-mode="require"/> | ||
value: number; | ||
activated?: boolean; | ||
} | ||
export {}; |
{ | ||
"name": "zz-chart", | ||
"version": "0.1.0-beta.38", | ||
"version": "0.1.0-beta.39", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "author": "Alauda", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
544935
14245