-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace flot with elastic-chart in Timelion #81565
Merged
Merged
Changes from 38 commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
ff810c8
First draft migrate timelion to elastic-charts
VladLasitsa 6d7f157
Some refactoring. Added brush event.
VladLasitsa b888e79
Merge remote-tracking branch 'origin/#79984' into #79984
VladLasitsa 999c2d7
Added title. Some refactoring
VladLasitsa f43a965
Fixed some type problems. Added logic for yaxes function
VladLasitsa af60792
Fixed some types, added missing functionality for yaxes
VladLasitsa f429afe
Fixed some types, added missing functionality for stack property
VladLasitsa c94a3fc
Merge branch 'master' into #79984
kibanamachine 5cd3a48
Fixed unit test
VladLasitsa 4b3a294
Removed unneeded code
VladLasitsa 1e7eee7
Some refactoring
VladLasitsa 901f8c7
Some refactoring
VladLasitsa 5942f9b
Merge branch 'master' into #79984
kibanamachine 60c1e11
Fixed some remarks.
VladLasitsa 4f8c59a
Fixed some styles
VladLasitsa 9be84d7
Added themes. Removed unneeded styles in BarSeries
VladLasitsa 6711dac
removed unneeded code.
VladLasitsa 6d74017
Fixed some comments
VladLasitsa 039d3b4
Merge remote-tracking branch 'upstream/master' into #79984
VladLasitsa de41259
Fixed vertical cursor across Timelion visualizations of a dashboad
VladLasitsa 63a12db
Fix some problems with styles
VladLasitsa 2726c0c
Merge remote-tracking branch 'upstream/master' into #79984
VladLasitsa 07181ae
Merge remote-tracking branch 'upstream/master' into #79984
VladLasitsa ca9aeac
Use RxJS instead of jQuery
VladLasitsa 13033c5
Remove unneeded code
VladLasitsa 703e3f3
Merge remote-tracking branch 'upstream/master' into #79984
VladLasitsa 18d9c37
Fixed some problems
VladLasitsa 53b1c08
Fixed unit test
VladLasitsa 6c8b842
Merge branch 'master' into #79984
kibanamachine c2ba661
Merge branch 'master' into #79984
VladLasitsa aac4b77
Fix CI
VladLasitsa 75fb061
Merge branch 'master' into #79984
kibanamachine 24a188a
Fix eslint
VladLasitsa 7ad545f
Merge branch 'master' into #79984
kibanamachine d369fc4
Fix some gaps
VladLasitsa 035516a
Merge branch 'master' into #79984
kibanamachine 15b6ec7
Fix legend columns
VladLasitsa b079e0d
Merge branch 'master' into #79984
kibanamachine 9944016
Some fixes
VladLasitsa 010617c
add 2 versions of Timeline app
alexwizp bc63434
fix CI
alexwizp 81add31
cleanup code
alexwizp 0bc12e1
fix CI
alexwizp 6f33935
fix legend position
alexwizp 56c0760
fix some cases
alexwizp f52fd07
fix some cases
alexwizp cd2cb7e
remove extra casting
alexwizp e4c3b96
cleanup code
alexwizp 451054c
fix issue with static
alexwizp 1898b8d
fix header formatter
alexwizp a1edcf5
fix points
alexwizp 641ffab
Merge remote-tracking branch 'upstream/master' into #79984
alexwizp d330823
fix ts error
alexwizp f087902
Fix yaxis behavior
VladLasitsa e4397bb
Merge branch 'master' into #79984
kibanamachine 9af9dcb
Fix some case with yaxis
VladLasitsa 0ca56a1
Merge remote-tracking branch 'upstream/master' into #79984
alexwizp a84fa78
Merge branch 'master' into #79984
kibanamachine 7ca06e1
Merge branch 'master' into #79984
kibanamachine 022b8a5
Merge branch 'master' into #79984
kibanamachine 0eb286f
Add deprecation message and update asciidoc
VladLasitsa 574d045
Merge branch 'master' into #79984
kibanamachine 572df6e
Fix title
VladLasitsa b027add
Merge branch 'master' into #79984
kibanamachine edab9a6
Merge branch 'master' into #79984
kibanamachine 5082a31
Merge branch 'master' into #79984
kibanamachine 8dd67ff
Merge branch 'master' into #79984
kibanamachine 33c9b70
Merge branch 'master' into #79984
kibanamachine 4d5292b
Merge branch 'master' into #79984
kibanamachine eac6a41
Merge branch 'master' into #79984
kibanamachine 757e95a
Merge branch 'master' into #79984
kibanamachine 56a94b4
Merge branch 'master' into #79984
kibanamachine c95ef4b
Merge remote-tracking branch 'upstream/master' into #79984
VladLasitsa bf63108
some text improvements
VladLasitsa acb6bce
Merge branch 'master' into #79984
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
.timChart { | ||
height: 100%; | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
|
||
// Custom Jquery FLOT / schema selectors | ||
// Cannot change at the moment | ||
|
||
.chart-top-title { | ||
@include euiFontSizeXS; | ||
flex: 0; | ||
text-align: center; | ||
font-weight: $euiFontWeightBold; | ||
} | ||
|
||
.chart-canvas { | ||
min-width: 100%; | ||
flex: 1; | ||
overflow: hidden; | ||
} | ||
|
||
.legendLabel { | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
overflow-x: hidden; | ||
line-height: normal; | ||
} | ||
|
||
.legendColorBox { | ||
vertical-align: middle; | ||
} | ||
|
||
.ngLegendValue { | ||
color: $euiTextColor; | ||
cursor: pointer; | ||
|
||
&:focus, | ||
&:hover { | ||
text-decoration: underline; | ||
} | ||
} | ||
|
||
.ngLegendValueNumber { | ||
margin-left: $euiSizeXS; | ||
margin-right: $euiSizeXS; | ||
font-weight: $euiFontWeightBold; | ||
} | ||
|
||
.flot-tick-label { | ||
font-size: $euiFontSizeXS; | ||
color: $euiColorDarkShade; | ||
} | ||
} | ||
|
||
.timChart__legendCaption { | ||
color: $euiTextColor; | ||
white-space: nowrap; | ||
font-weight: $euiFontWeightBold; | ||
} | ||
|
||
.chart-top-title { | ||
@include euiFontSizeXS; | ||
flex: 0; | ||
text-align: center; | ||
font-weight: $euiFontWeightBold; | ||
} |
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
55 changes: 55 additions & 0 deletions
55
src/plugins/vis_type_timelion/public/components/area_series/index.tsx
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { AreaSeries, ScaleType, CurveType } from '@elastic/charts'; | ||
|
||
export function AreaSeriesComponent({ data, index }: { data: any; index: number }) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a question, do we know, what shape of data is comming at this prop and can we describe it by providing types? |
||
const lines = data.lines || {}; | ||
const points = data.points || {}; | ||
const styles = { | ||
areaSeriesStyle: { | ||
line: { | ||
stroke: data.color, | ||
strokeWidth: Number(lines.lineWidth) || 3, | ||
VladLasitsa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
visible: lines.show ?? !points.show, | ||
}, | ||
area: { | ||
fill: data.color, | ||
opacity: lines.fill ?? 0, | ||
visible: lines.show ?? !points.show, | ||
}, | ||
point: { | ||
fill: points.fillColor, | ||
opacity: points.fill * 10 ?? 10, | ||
radius: points.radius || 3, | ||
VladLasitsa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
stroke: data.color, | ||
strokeWidth: points.lineWidth || 2, | ||
VladLasitsa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
visible: points.show ?? false, | ||
shape: points.symbol, | ||
}, | ||
}, | ||
curve: lines.steps ? CurveType.CURVE_STEP : CurveType.LINEAR, | ||
}; | ||
|
||
return ( | ||
<AreaSeries | ||
id={index + data.label} | ||
name={data.label} | ||
xScaleType={ScaleType.Time} | ||
yScaleType={ScaleType.Linear} | ||
xAccessor={0} | ||
yAccessors={[1]} | ||
data={data.data} | ||
sortIndex={index} | ||
color={data.color} | ||
stackAccessors={data.stack ? [0] : undefined} | ||
stratoula marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{...styles} | ||
/> | ||
); | ||
} |
39 changes: 39 additions & 0 deletions
39
src/plugins/vis_type_timelion/public/components/bar_series/index.tsx
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { BarSeries, ScaleType } from '@elastic/charts'; | ||
|
||
export function BarSeriesComponent({ data, index }: { data: any; index: number }) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same question, as before. |
||
const bars = data.bars || {}; | ||
const styles = { | ||
barSeriesStyle: { | ||
rect: { | ||
fill: data.color, | ||
opacity: !bars.fill || bars.fill < 0 ? 1 : bars.fill, | ||
VladLasitsa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
widthPixel: bars.lineWidth, | ||
}, | ||
}, | ||
}; | ||
|
||
return ( | ||
<BarSeries | ||
id={index + data.label} | ||
name={data.label} | ||
xScaleType={ScaleType.Time} | ||
yScaleType={ScaleType.Linear} | ||
xAccessor={0} | ||
yAccessors={[1]} | ||
data={data.data} | ||
sortIndex={index} | ||
color={data.color} | ||
stackAccessors={data.stack ? [0] : undefined} | ||
{...styles} | ||
/> | ||
); | ||
} |
57 changes: 5 additions & 52 deletions
57
src/plugins/vis_type_timelion/public/components/timelion_vis.scss
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,60 +1,13 @@ | ||
.timChart { | ||
.timelionChart { | ||
height: 100%; | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
|
||
// Custom Jquery FLOT / schema selectors | ||
// Cannot change at the moment | ||
|
||
.chart-top-title { | ||
@include euiFontSizeXS; | ||
flex: 0; | ||
text-align: center; | ||
font-weight: $euiFontWeightBold; | ||
} | ||
|
||
.chart-canvas { | ||
min-width: 100%; | ||
flex: 1; | ||
overflow: hidden; | ||
} | ||
|
||
.legendLabel { | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
overflow-x: hidden; | ||
line-height: normal; | ||
} | ||
|
||
.legendColorBox { | ||
vertical-align: middle; | ||
} | ||
|
||
.ngLegendValue { | ||
color: $euiTextColor; | ||
cursor: pointer; | ||
|
||
&:focus, | ||
&:hover { | ||
text-decoration: underline; | ||
} | ||
} | ||
|
||
.ngLegendValueNumber { | ||
margin-left: $euiSizeXS; | ||
margin-right: $euiSizeXS; | ||
font-weight: $euiFontWeightBold; | ||
} | ||
|
||
.flot-tick-label { | ||
font-size: $euiFontSizeXS; | ||
color: $euiColorDarkShade; | ||
} | ||
} | ||
|
||
.timChart__legendCaption { | ||
color: $euiTextColor; | ||
white-space: nowrap; | ||
.timelionChart__topTitle { | ||
VladLasitsa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@include euiFontSizeXS; | ||
flex: 0; | ||
VladLasitsa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
text-align: center; | ||
font-weight: $euiFontWeightBold; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are completely removing Flot, can we check this comment and remove the CSS here that are no longer required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As timelion app will be removed soon we replaced Flot only for vis_type_timelion.