-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(scales): bisect correctly on continuous scales (#346)
This commit fix the wrong behaviour of the current invertWithStep implementation. It also fix the behaviour of cursor sync between charts with only lines and charts with only bars and empty intervals. It also removes the annotation dependency on ticks fix #227, fix #221
- Loading branch information
Showing
21 changed files
with
535 additions
and
525 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,25 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
Axis, | ||
Chart, | ||
getAxisId, | ||
getSpecId, | ||
niceTimeFormatter, | ||
Position, | ||
ScaleType, | ||
Settings, | ||
AreaSeries, | ||
getGroupId, | ||
} from '../src'; | ||
import { Axis, Chart, getAxisId, getSpecId, Position, ScaleType, Settings, BarSeries } from '../src'; | ||
import { KIBANA_METRICS } from '../src/utils/data_samples/test_dataset_kibana'; | ||
export class Playground extends React.Component { | ||
ref1 = React.createRef<Chart>(); | ||
ref2 = React.createRef<Chart>(); | ||
ref3 = React.createRef<Chart>(); | ||
|
||
export class Playground extends React.Component { | ||
render() { | ||
return ( | ||
<Chart> | ||
<Settings | ||
tooltip={{ type: 'vertical' }} | ||
debug={false} | ||
legendPosition={Position.Right} | ||
showLegend={true} | ||
rotation={0} | ||
/> | ||
<Axis | ||
id={getAxisId('timestamp')} | ||
title="timestamp" | ||
position={Position.Bottom} | ||
tickFormat={niceTimeFormatter([1555819200000, 1555905600000])} | ||
/> | ||
<Axis id={getAxisId('A axis')} title="A" position={Position.Left} tickFormat={(d) => `GA: ${d.toFixed(2)}`} /> | ||
<Axis | ||
id={getAxisId('B axis')} | ||
groupId={getGroupId('aaa')} | ||
title="B" | ||
hide={true} | ||
position={Position.Left} | ||
tickFormat={(d) => `GB: ${d.toFixed(2)}`} | ||
/> | ||
<AreaSeries | ||
id={getSpecId('dataset A1')} | ||
xScaleType={ScaleType.Linear} | ||
yScaleType={ScaleType.Linear} | ||
data={KIBANA_METRICS.metrics.kibana_os_load[0].data.slice(0, 50)} | ||
xAccessor={0} | ||
yAccessors={[1]} | ||
stackAccessors={[0]} | ||
/> | ||
<AreaSeries | ||
id={getSpecId('dataset A2')} | ||
xScaleType={ScaleType.Linear} | ||
yScaleType={ScaleType.Linear} | ||
data={KIBANA_METRICS.metrics.kibana_os_load[1].data.slice(0, 50)} | ||
xAccessor={0} | ||
yAccessors={[1]} | ||
stackAccessors={[0]} | ||
/> | ||
<AreaSeries | ||
id={getSpecId('dataset B1')} | ||
groupId={getGroupId('aaa')} | ||
useDefaultGroupDomain={true} | ||
xScaleType={ScaleType.Time} | ||
yScaleType={ScaleType.Linear} | ||
data={KIBANA_METRICS.metrics.kibana_os_load[0].data.slice(0, 50).map((d) => [d[0], -d[1]])} | ||
xAccessor={0} | ||
yAccessors={[1]} | ||
stackAccessors={[0]} | ||
/> | ||
<AreaSeries | ||
id={getSpecId('dataset B2')} | ||
groupId={getGroupId('aaa')} | ||
xScaleType={ScaleType.Time} | ||
yScaleType={ScaleType.Linear} | ||
data={KIBANA_METRICS.metrics.kibana_os_load[0].data.slice(0, 50).map((d) => [d[0], -d[1]])} | ||
xAccessor={0} | ||
yAccessors={[1]} | ||
stackAccessors={[0]} | ||
/> | ||
</Chart> | ||
<div className="chart"> | ||
<Chart> | ||
<Settings showLegend={true} /> | ||
<Axis id={getAxisId('y')} position={Position.Left} /> | ||
<Axis id={getAxisId('x')} position={Position.Bottom} /> | ||
<BarSeries | ||
id={getSpecId('bar')} | ||
yScaleType={ScaleType.Linear} | ||
xScaleType={ScaleType.Time} | ||
xAccessor={0} | ||
yAccessors={[1]} | ||
data={KIBANA_METRICS.metrics.kibana_os_load[0].data.slice(0, 15)} | ||
/> | ||
</Chart> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.