-
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(renderer): stroke opacity (#335)
* Make stroke opacity independent from fill opacity * Changed shared opacity style to be an opacity multiplication __factor__ not a replaced value
- Loading branch information
1 parent
70b0aa1
commit d8c8459
Showing
9 changed files
with
560 additions
and
278 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,63 @@ | ||
import React from 'react'; | ||
import { Axis, Chart, getAxisId, getSpecId, Position, ScaleType, Settings, BarSeries } from '../src'; | ||
|
||
import { Axis, Chart, getAxisId, getSpecId, niceTimeFormatter, Position, ScaleType, Settings, BarSeries } from '../src'; | ||
import { KIBANA_METRICS } from '../src/utils/data_samples/test_dataset_kibana'; | ||
import { CursorEvent } from '../src/specs/settings'; | ||
import { CursorUpdateListener } from '../src/chart_types/xy_chart/store/chart_state'; | ||
|
||
export class Playground extends React.Component { | ||
ref1 = React.createRef<Chart>(); | ||
ref2 = React.createRef<Chart>(); | ||
ref3 = React.createRef<Chart>(); | ||
|
||
onCursorUpdate: CursorUpdateListener = (event?: CursorEvent) => { | ||
this.ref1.current!.dispatchExternalCursorEvent(event); | ||
this.ref2.current!.dispatchExternalCursorEvent(event); | ||
this.ref3.current!.dispatchExternalCursorEvent(event); | ||
}; | ||
|
||
render() { | ||
return ( | ||
<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> | ||
<Chart> | ||
<Settings tooltip={{ type: 'vertical' }} debug={false} legendPosition={Position.Right} showLegend={true} /> | ||
<Axis | ||
id={getAxisId('timestamp')} | ||
title="timestamp" | ||
position={Position.Bottom} | ||
tickFormat={niceTimeFormatter([1555819200000, 1555905600000])} | ||
/> | ||
<Axis id={getAxisId('count')} title="count" position={Position.Left} tickFormat={(d) => d.toFixed(2)} /> | ||
<BarSeries | ||
id={getSpecId('dataset B')} | ||
xScaleType={ScaleType.Time} | ||
yScaleType={ScaleType.Linear} | ||
data={KIBANA_METRICS.metrics.kibana_os_load[1].data.slice(0, 15)} | ||
xAccessor={0} | ||
yAccessors={[1]} | ||
stackAccessors={[0]} | ||
barSeriesStyle={{ | ||
rectBorder: { | ||
strokeOpacity: 1, | ||
strokeWidth: 4, | ||
stroke: 'blue', | ||
visible: true, | ||
}, | ||
rect: { | ||
opacity: 0.25, | ||
fill: 'red', | ||
}, | ||
}} | ||
/> | ||
<BarSeries | ||
id={getSpecId('dataset C')} | ||
xScaleType={ScaleType.Time} | ||
yScaleType={ScaleType.Linear} | ||
data={KIBANA_METRICS.metrics.kibana_os_load[1].data.slice(0, 15)} | ||
xAccessor={0} | ||
yAccessors={[1]} | ||
stackAccessors={[0]} | ||
/> | ||
</Chart> | ||
); | ||
} | ||
} |
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
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
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.