Skip to content
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 refactor nr5 #8950

Merged

Conversation

ppisljar
Copy link
Member

@ppisljar ppisljar commented Nov 3, 2016

another PR in vislib refactor series ...

i tried to make commits as clear as possible, each commit should be one change.

also take a look at PoC branch which is based on top of this ...

(cherry picked from commit 29c2021
(the others are left for backward compatibility)
(cherry picked from commit b1bd840)
(cherry picked from commit f658a41)
(cherry picked from commit 1226445)
(cherry picked from commit 6726ef6)
(cherry picked from commit 36f283a)
(cherry picked from commit 7853c86)
(cherry picked from commit c15667e)
(cherry picked from commit f9ddcb2)
(cherry picked from commit 801429b)
Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple notes but LGTM

@@ -64,7 +64,16 @@ export default function ColumnHandler(Private) {
config.chart = {
type: 'point_series',
series: _.map(series, (seri) => {
return _.defaults({}, cfg, {
return _.defaults({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This _.defaults() call is unnecessary

@@ -198,9 +198,9 @@ export default function AxisFactory(Private) {
}

getLength(el, n) {
const margin = this.visConfig.get('style.margin');
const widthSpacing = 43;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this number come from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll get rid of it

@spalger
Copy link
Contributor

spalger commented Nov 4, 2016

While playing around with this I wrote down some of the bugs that I found that seemed to be from outside of this pr, but that need to be fixed before we can merge the vislib-axis-refactor branch into master

#8962

});
};

updateCategoryAxisSize() {
Copy link
Member Author

@ppisljar ppisljar Nov 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function (similar) existed on y_axis_split before ...

  • it would pre-render y axis and update its width so that x axis can then render correctly.
  • after x axis is rendered it would update y-axis height so that y axis can render correctly

this seemed super weird so my first step was just removing the pre-render part, but now i see we probably need it so

  • i would pre-render category axis (no matter of its position) and update its width/height (depending on positon) and in case its a horizontal one update y-axis-spacer-block as well. . i decided to go with category axis as there is only one. with value axes we would need to pre-render them all. this way value axes can now render correctly

  • first render the value axes ... we dont need to update anything more after that (so updateXaxisHeight function on axis is not needed anymore)

    i moved function to the Layout as we can only call it once whole layout has rendered. (y-axis-split wouldnt work)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this fix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong sizing of category axis (it was either too long or too short) and it gets rid of that magic number (which worked just in case your value axis was 43 pixels wide/tall :)

@ppisljar
Copy link
Member Author

ppisljar commented Nov 4, 2016

@spalger i updated based on your comments. would you prefer that i fix the issues you found in a separate PR ?

@ppisljar ppisljar changed the title Vislib axis refactor 5 Vislib refactor nr5 Nov 4, 2016
@thomasneirynck thomasneirynck self-assigned this Nov 4, 2016
@spalger
Copy link
Contributor

spalger commented Nov 4, 2016

Yeah, I would prefer to take care of those outside of this pr.

@ppisljar ppisljar force-pushed the vislib-axis-refactor-5 branch from 08d0611 to 43d3930 Compare November 5, 2016 08:00
@ppisljar ppisljar merged commit 30e3fd4 into elastic:vislib-axis-refactor Nov 5, 2016
ppisljar added a commit to ppisljar/kibana that referenced this pull request Nov 11, 2016
* moving margin to css
* adding point_series type
(the others are left for backward compatibility)
* adding series default options
* fixing alignment of axes
* injectZeros should be applied per value axis
* fixing error in axis matching
* fixing style (indentation)
* fixing tooltips
* fixing axisformatter
* making grouped/overlap the default mode
* making charts direction independent
* fixing tests
@tbragin tbragin added the Feature:Visualizations Generic visualization features (in case no more specific feature label is available) label Dec 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants