-
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
Vislib Point Series updates #9044
Conversation
afb5976
to
3e08766
Compare
3e08766
to
4b84d22
Compare
pie: Private(VislibLibLayoutTypesPieLayoutProvider), | ||
tile_map: Private(VislibLibLayoutTypesMapLayoutProvider) | ||
tile_map: Private(VislibLibLayoutTypesMapLayoutProvider), | ||
point_series: Private(VislibLibLayoutTypesColumnLayoutProvider) |
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.
Is it safe to assume that point_series is now a base layout type for histogram, line, and area layouts?
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.
yes, even more maybe. point series is now a base chart like pie. area, line and bars are just its series implementations.
type: 'div', | ||
class: 'x-axis-chart-title', | ||
splits: chartTitleSplit | ||
},*/ |
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.
Can we delete this commented-out code?
type: 'div', | ||
class: 'y-axis-chart-title', | ||
splits: chartTitleSplit | ||
},*/ |
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.
Can we delete this commented-out code?
this.charts.forEach(function (chart) { | ||
chart.resizeArea(); | ||
}); | ||
};*/ |
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.
Can we delete this commented-out code?
}; | ||
|
||
draw() { | ||
// todo: do we need to handle width and height here ? |
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.
Might want to uppercase TODO
here for consistency with other TODOs in the code.
|
||
export default function PointSeriProvider(Private) { | ||
|
||
class PointSeri { |
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.
Is this name a typo? I don't think "seri" is a word I've ever seen before (and I couldn't find any definition for it online), so the name doesn't help me understand the role of this class. Would just using "series" make sense for the role of this class?
This suggestion applies to the seri_types.js
file too. That should be series_types
I think.
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.
Yeah, series
is a troublesome word. What's the plural of series
? serieses
? it's a bit of a shock at first to me as well, but I think we might be better off just moving away from series
entirely.
This is amazing. It's such a huge PR, it's hard for me to wrap my head around so my comments are pretty limited. But from looking at the change in folder structure and how the code has been restructured, I can tell it's a little bit easier to dive into and understand (and scale). I think two things could really help make vislib more accessible for everyone:
Like I said, though... this is stellar. Thanks for doing this man. LGTM. |
thanks @cjcenizal for looking into this. I updated based on your comments. the high level overview will need to get extended but it is a starting point i guess. let me know if you have specific questions you would like me to answer in there. @spalger was reviewing my work along the way, thanks a lot for this again, so i think now it would be very useful to test this with diff datasets, there are probably things we didn't think off and its very important that this change in deed does work exactly as it did before for the end user. |
this is obviously a little big to give detailed line-by-line feedback, so I'll try and summarize here:
I tested this with existing line, bar-charts, and area-chart visualizations I had saved, and they continued to work. Creating, editing and saving these visualizations was not a problem. As for whatever version this will go in, I think this needs to go through manual testing. I looked at the existing visualize-section of our tests, and it is already pretty extensive. But specifically, I think we should add manual tests for upgrading between Kibana versions of pre-vislib /post-vislib refactor, which is missing now. Right now, we have similar manual tests for 4->5 upgrades, in the context of the Dashboard. It will be beneficial to have a few specific ones for line/column/area-charts as well solely in the context of Visualize. Perhaps @LeeDr can offer some advice here. |
@ppisljar From a functional review standpoint, since our goal is to ensure no regressions occur as a result of this PR, in no particular order, I'll use this ticket to mention any differences I see between this PR on top of master and 5.0.1. I don't know if any of the changes I notice is due to this PR or master, but nevertheless, here they go:
|
@tbragin thanks a lot for this !
|
Is the CSV export weird characters issue related to #8637 |
|
@LeeDr yeah it could be. We didnt' change anything around CSV in this PR as far as I'm aware |
f0a0595
to
23bf6d3
Compare
i squashed the commit and rebased on master. let me know if anyone objects. (commits get squashed on merge anyway) ... the original history can still be seen here |
@ppisljar Pulled down latest changes, confirm partial bucket issue, pie chart legend, and legend cut off as addressed. |
d000edd
to
6ae541d
Compare
@@ -12,6 +12,8 @@ import $ from 'jquery'; | |||
import VislibLibLayoutLayoutProvider from 'ui/vislib/lib/layout/layout'; | |||
import FixturesVislibVisFixtureProvider from 'fixtures/vislib/_vis_fixture'; | |||
import PersistedStatePersistedStateProvider from 'ui/persisted_state/persisted_state'; | |||
import VislibVisConfig from 'ui/vislib/lib/vis_config'; |
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.
I think absolute is fine in this case. most unit tests in Kibana seem to use absolute paths
expect($(vis.el).find('.x-axis-title').length).to.be(1); | ||
expect($(vis.el).find('.x-axis-wrapper').length).to.be(2); | ||
expect($(vis.el).find('.x-axis-div-wrapper').length).to.be(2); | ||
expect($(vis.el).find('.x-axis-title').length).to.be(2); |
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.
I think the magic numbers are OK here. This is really a test for internal implementation details anyways.
moving y-axis methods inside axis class updating handler to use Axis for yAxis as well introducting 'type' property to differ between X and Y axis joining x_axis and y_axis into a single class axis - splitting it into 3 subclasses (Axis, AxisLabels, AxisScale) - converting to ES6 classes + style fixes - adding more customization options updating handler to work with new Axis class - allowing handler to have multiple category/value axes (array) converting axis_title to ES6 classes and making it work with new axis updating column layout to support left/right top/bottom positioning of axis - updating css min-widths to 1px (removing them breaks the code) as we dont want to reserve the space for axes that dont exist. introducing AxisConfig class adding ordered and values back to axis to make other parts of vislib working renaming axis.scale to axis.axisScale removing comments adding scale type config removing unnecesarry configs (never used) adding point series chart type updating all charts introducing VisConfig class moving wiggle, silluete and stacking to axis fixing based on last spencers review add label to zero filled values allow custom values on catwegory axis adding clip path updating defaults to match current vislib implementation seri.show parameter vertical category axis positioning fixing more issues fixing broken pie charts increasing default truncate length fixing expandLastBucket option
…gative values correctly)
b0ee1d0
to
9e8d71f
Compare
Backports PR #9044 **Commit 1:** renaming x-axis to axis moving y-axis methods inside axis class updating handler to use Axis for yAxis as well introducting 'type' property to differ between X and Y axis joining x_axis and y_axis into a single class axis - splitting it into 3 subclasses (Axis, AxisLabels, AxisScale) - converting to ES6 classes + style fixes - adding more customization options updating handler to work with new Axis class - allowing handler to have multiple category/value axes (array) converting axis_title to ES6 classes and making it work with new axis updating column layout to support left/right top/bottom positioning of axis - updating css min-widths to 1px (removing them breaks the code) as we dont want to reserve the space for axes that dont exist. introducing AxisConfig class adding ordered and values back to axis to make other parts of vislib working renaming axis.scale to axis.axisScale removing comments adding scale type config removing unnecesarry configs (never used) adding point series chart type updating all charts introducing VisConfig class moving wiggle, silluete and stacking to axis fixing based on last spencers review add label to zero filled values allow custom values on catwegory axis adding clip path updating defaults to match current vislib implementation seri.show parameter vertical category axis positioning fixing more issues fixing broken pie charts increasing default truncate length fixing expandLastBucket option * Original sha: ba74498 * Authored by ppisljar <[email protected]> on 2016-09-13T10:59:17Z **Commit 2:** fixing selenium tests by increasing barHeightTolerance * Original sha: f27f8a1 * Authored by ppisljar <[email protected]> on 2016-11-22T09:40:25Z **Commit 3:** fixing axis alignment (1px off) * Original sha: 3d6267e * Authored by ppisljar <[email protected]> on 2016-11-22T12:19:37Z **Commit 4:** fixing layout elements min-height to 0 * Original sha: 619a495 * Authored by ppisljar <[email protected]> on 2016-11-22T12:20:20Z **Commit 5:** point radius should be calculated per chart * Original sha: be16b14 * Authored by ppisljar <[email protected]> on 2016-11-22T13:35:27Z **Commit 6:** adding clip path to circles * Original sha: 188131b * Authored by ppisljar <[email protected]> on 2016-11-22T13:43:55Z **Commit 7:** seting min height 0 on axis * Original sha: 231a58a * Authored by ppisljar <[email protected]> on 2016-11-22T14:45:12Z **Commit 8:** adding background class * Original sha: c41e672 * Authored by ppisljar <[email protected]> on 2016-11-22T15:27:02Z **Commit 9:** fixing selenium tests * Original sha: ed1b330 * Authored by ppisljar <[email protected]> on 2016-11-22T15:27:40Z **Commit 10:** update visualize legend to correctly check if it should show * Original sha: 9bd80be * Authored by ppisljar <[email protected]> on 2016-11-23T10:33:06Z **Commit 11:** fixing based on CJs comments * Original sha: 02a22d0 * Authored by ppisljar <[email protected]> on 2016-12-01T06:44:37Z **Commit 12:** improving stacking of negative values * Original sha: 9d79d79 * Authored by ppisljar <[email protected]> on 2016-12-01T06:55:33Z **Commit 13:** updating class name to better match element * Original sha: 628408d * Authored by ppisljar <[email protected]> on 2016-12-01T06:56:11Z **Commit 14:** fixing charts with mixed (negative/positive) values * Original sha: 682ab0b * Authored by ppisljar <[email protected]> on 2016-12-01T09:44:49Z **Commit 15:** fixing test (stacking happens for grouped charts as well to handle negative values correctly) * Original sha: 69a53ea * Authored by ppisljar <[email protected]> on 2016-12-01T09:52:29Z **Commit 16:** fixing based on CJs last comments * Original sha: 9e8d71f * Authored by ppisljar <[email protected]> on 2016-12-01T16:05:31Z **Commit 17:** fixing unstable selenium test * Original sha: f36b6fc * Authored by ppisljar <[email protected]> on 2016-12-06T11:20:30Z
Backports PR #9044 **Commit 1:** renaming x-axis to axis moving y-axis methods inside axis class updating handler to use Axis for yAxis as well introducting 'type' property to differ between X and Y axis joining x_axis and y_axis into a single class axis - splitting it into 3 subclasses (Axis, AxisLabels, AxisScale) - converting to ES6 classes + style fixes - adding more customization options updating handler to work with new Axis class - allowing handler to have multiple category/value axes (array) converting axis_title to ES6 classes and making it work with new axis updating column layout to support left/right top/bottom positioning of axis - updating css min-widths to 1px (removing them breaks the code) as we dont want to reserve the space for axes that dont exist. introducing AxisConfig class adding ordered and values back to axis to make other parts of vislib working renaming axis.scale to axis.axisScale removing comments adding scale type config removing unnecesarry configs (never used) adding point series chart type updating all charts introducing VisConfig class moving wiggle, silluete and stacking to axis fixing based on last spencers review add label to zero filled values allow custom values on catwegory axis adding clip path updating defaults to match current vislib implementation seri.show parameter vertical category axis positioning fixing more issues fixing broken pie charts increasing default truncate length fixing expandLastBucket option * Original sha: ba74498 * Authored by ppisljar <[email protected]> on 2016-09-13T10:59:17Z **Commit 2:** fixing selenium tests by increasing barHeightTolerance * Original sha: f27f8a1 * Authored by ppisljar <[email protected]> on 2016-11-22T09:40:25Z **Commit 3:** fixing axis alignment (1px off) * Original sha: 3d6267e * Authored by ppisljar <[email protected]> on 2016-11-22T12:19:37Z **Commit 4:** fixing layout elements min-height to 0 * Original sha: 619a495 * Authored by ppisljar <[email protected]> on 2016-11-22T12:20:20Z **Commit 5:** point radius should be calculated per chart * Original sha: be16b14 * Authored by ppisljar <[email protected]> on 2016-11-22T13:35:27Z **Commit 6:** adding clip path to circles * Original sha: 188131b * Authored by ppisljar <[email protected]> on 2016-11-22T13:43:55Z **Commit 7:** seting min height 0 on axis * Original sha: 231a58a * Authored by ppisljar <[email protected]> on 2016-11-22T14:45:12Z **Commit 8:** adding background class * Original sha: c41e672 * Authored by ppisljar <[email protected]> on 2016-11-22T15:27:02Z **Commit 9:** fixing selenium tests * Original sha: ed1b330 * Authored by ppisljar <[email protected]> on 2016-11-22T15:27:40Z **Commit 10:** update visualize legend to correctly check if it should show * Original sha: 9bd80be * Authored by ppisljar <[email protected]> on 2016-11-23T10:33:06Z **Commit 11:** fixing based on CJs comments * Original sha: 02a22d0 * Authored by ppisljar <[email protected]> on 2016-12-01T06:44:37Z **Commit 12:** improving stacking of negative values * Original sha: 9d79d79 * Authored by ppisljar <[email protected]> on 2016-12-01T06:55:33Z **Commit 13:** updating class name to better match element * Original sha: 628408d * Authored by ppisljar <[email protected]> on 2016-12-01T06:56:11Z **Commit 14:** fixing charts with mixed (negative/positive) values * Original sha: 682ab0b * Authored by ppisljar <[email protected]> on 2016-12-01T09:44:49Z **Commit 15:** fixing test (stacking happens for grouped charts as well to handle negative values correctly) * Original sha: 69a53ea * Authored by ppisljar <[email protected]> on 2016-12-01T09:52:29Z **Commit 16:** fixing based on CJs last comments * Original sha: 9e8d71f * Authored by ppisljar <[email protected]> on 2016-12-01T16:05:31Z **Commit 17:** fixing unstable selenium test * Original sha: f36b6fc * Authored by ppisljar <[email protected]> on 2016-12-06T11:20:30Z
Multiple changes to the Vislib point series charts. Before each of the chart (bar/area/line) would be an independent unit responsible for drawing all of its parts (axes, titles). This change splits things up so we can have greater control and better code reuse.
This change should have no impact on the current way Kibana works/looks. All the visualizations should stay the same, no new options were added and the existing ones should keep working just as they did. But this will allow to implement many functionalities that are being asked for a lot like multiple Y axes, switching between line/area/bar chart easily, multiple chart types on one visualization, horizontal bar charts and heatmaps for example.
Fixes:
vislib performs width/height calculations redundantly #6555
Histogram bar hover only works once #5930
[vislib] Point series charts hould have bottom line #4067
"Container is too small" flashes briefly #3359
For posterity, this pr was submitted in several smaller prs: #8252, #8253, #8254, #8275, #8329, #8950, #8987