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

Small multiples in vis_type_xy plugin #86880

Merged
merged 30 commits into from
Jan 25, 2021

Conversation

DianaDerevyankina
Copy link
Contributor

@DianaDerevyankina DianaDerevyankina commented Dec 23, 2020

Closes #82496

Summary

Added split chart aggregation support in visualize for newChartUi

small multiples

  • Removed existing warning message
    (before)
    image
  • Enabled Split chart option and removed the tooltip
    (before)
    image
  • Update advanced setting wording
    (before)
    image
    (after)
    image

Checklist

For maintainers

@DianaDerevyankina DianaDerevyankina added Feature:XYAxis XY-Axis charts (bar, area, line) Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.11.0 v7.12.0 labels Dec 23, 2020
@DianaDerevyankina DianaDerevyankina self-assigned this Dec 23, 2020
@alexwizp alexwizp removed the v7.11.0 label Dec 29, 2020
const seriesDimensions = Array.isArray(series) || series === undefined ? series : [series];

return {
x: getAspectsFromDimension(columns, x) ?? getEmptyAspect(),
y: getAspectsFromDimension(columns, y) ?? [],
z: z && z?.length > 0 ? getAspectsFromDimension(columns, z[0]) : undefined,
series: getAspectsFromDimension(columns, seriesDimensions),
splitColumn:
splitColumn && splitColumn?.length > 0
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: splitColumn && splitColumn?.length > 0 === splitColumn?.length

? getAspectsFromDimension(columns, splitColumn[0])
: undefined,
splitRow:
splitRow && splitRow?.length > 0 ? getAspectsFromDimension(columns, splitRow[0]) : undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: splitRow && splitRow?.length > 0 -> splitRow?.length

@alexwizp alexwizp requested a review from stratoula January 6, 2021 11:29
@stratoula
Copy link
Contributor

@elasticmachine merge upstream

@alexwizp
Copy link
Contributor

@nickofthyme please review that. Do you have any concerns around that?

@stratoula
Copy link
Contributor

I haven't checked the code yet but I don't think that it works as we want. I can see my charts split on a Range agg but on a terms aggregation, for example, they don't. Or at least, it doesn't work on any case.

I have this configuration and on the legacy creates two charts
Screenshot 2021-01-13 at 2 31 53 PM

but on the new xy axis
Screenshot 2021-01-13 at 2 32 43 PM

Moreover, I don't think that the legend should be repeated

Screenshot 2021-01-13 at 2 41 15 PM

@nickofthyme
Copy link
Contributor

@dziyanadzeraviankina,

I think I solved the issue with the intervals being different between the two implementations.

See this pr for details DianaDerevyankina#1.

I am looking to see how we could increase the scaled interval based on the number of vertical split chart panels.

I also noticed that if the interval is small enough where the scale value is used in the es query, the click filter is using the user-defined interval value.

Happy to discuss it tomorrow.


@stratoula,

I will look into the issue with the terms aggregation.

The other issue related to the multiple legend values is an issue that Marco is resolving on the elastic-charts side.

@stratoula
Copy link
Contributor

stratoula commented Jan 14, 2021

Thanx @nickofthyme, @dziyanadzeraviankina one more thing. Now that the new palette service is integrated on the xy plugin, you should also check if it works correctly with the split chart (merged yesterday on master)

# Conflicts:
#	src/plugins/vis_type_xy/public/components/split_chart_warning.tsx
#	src/plugins/vis_type_xy/public/vis_types/split_tooltip.tsx
Copy link
Contributor

@alexwizp alexwizp left a comment

Choose a reason for hiding this comment

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

LGTM

@sulemanof
Copy link
Contributor

Haven't checked the code yet, but found next issues (maybe some of that are made on purpose, but in that case I would appreciate for documenting them in the PR description).

  1. axes don't have the same labels calculated in split chart mode:

    • vislib split by columns

    image

    • xy chart split by columns

      image

    • vislib split by rows

      image

    • xy chart split by rows

      image

  2. Each metric is duplicated by each split chart:
    Screen Shot 2021-01-20 at 14 58 05

    which leads to "metrics legend hell" 🥶
    Screen Shot 2021-01-20 at 15 06 05

    In vislib each metric is repeated only once; hovering over a metric highlights all selected metrics across all charts - could we replicate the same in xy chart?

Except these small issues, everything seems to work fine 👍 ❤️

@stratoula
Copy link
Contributor

@sulemanof about the multiple labels I had asked the same, check Nick's reply #86880 (comment), it seems that it should be fixed on es-charts side.

@nickofthyme
Copy link
Contributor

nickofthyme commented Jan 20, 2021

@sulemanof, @stratoula is right the duplicated legend values are something we are working to fix now.

As for the axes don't have the same labels calculated in split chart mode, we are can open an issue for a secondary axis title in elastic charts. See elastic/elastic-charts#985 and elastic/elastic-charts#986

@DianaDerevyankina
Copy link
Contributor Author

@elasticmachine merge upstream

@DianaDerevyankina
Copy link
Contributor Author

@elasticmachine merge upstream

@stratoula stratoula marked this pull request as ready for review January 25, 2021 08:42
@stratoula stratoula requested a review from a team January 25, 2021 08:42
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@stratoula
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@sulemanof sulemanof left a comment

Choose a reason for hiding this comment

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

Code LGTM, checked locally in Chrome in Visualize & Dashboard applications, works fine 💞

src/plugins/vis_type_xy/public/chart_splitter.tsx Outdated Show resolved Hide resolved
@kibanamachine
Copy link
Contributor

kibanamachine commented Jan 25, 2021

⏳ Build in-progress, with failures

Failed CI Steps

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@alexwizp
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

LGTM, tested it locally on safari, works fine 🙂 thanx @dziyanadzeraviankina for the functional test!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
visTypeXy 108 107 -1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
visTypeVislib 643.6KB 643.6KB -27.0B
visTypeXy 157.8KB 160.2KB +2.4KB
total +2.4KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
charts 164.0KB 165.6KB +1.6KB
visTypeXy 69.5KB 62.1KB -7.4KB
total -5.7KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@DianaDerevyankina DianaDerevyankina merged commit 191ad14 into elastic:master Jan 25, 2021
DianaDerevyankina added a commit to DianaDerevyankina/kibana that referenced this pull request Jan 25, 2021
* Small multiples in vis_type_xy plugin

* Fix tooltip and formatted split chart values

* update advanced settings wording

* Remove React import in files with no JSX and change the extension to .ts

* Simplify conditions

* fix bar interval on split charts in vislib

* Fix charts not splitting for terms boolean fields

* fix filtering for small multiples

* Change tests interval values from 100 to 1000000

* Revert "Change tests interval values from 100 to 1000000"

This reverts commit 92f9d1b.

* Fix tests for interval issue in vislib

(cherry picked from commit ef45b63)

* Revert axis_scale changes related to interval

* Enable _line_chart_split_chart test for new charts library

* Move chart splitter id to const

Co-authored-by: nickofthyme <nick.ryan.partridge@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
DianaDerevyankina added a commit that referenced this pull request Jan 25, 2021
* Small multiples in vis_type_xy plugin

* Fix tooltip and formatted split chart values

* update advanced settings wording

* Remove React import in files with no JSX and change the extension to .ts

* Simplify conditions

* fix bar interval on split charts in vislib

* Fix charts not splitting for terms boolean fields

* fix filtering for small multiples

* Change tests interval values from 100 to 1000000

* Revert "Change tests interval values from 100 to 1000000"

This reverts commit 92f9d1b.

* Fix tests for interval issue in vislib

(cherry picked from commit ef45b63)

* Revert axis_scale changes related to interval

* Enable _line_chart_split_chart test for new charts library

* Move chart splitter id to const

Co-authored-by: nickofthyme <nick.ryan.partridge@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: nickofthyme <nick.ryan.partridge@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:XYAxis XY-Axis charts (bar, area, line) release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Small multiples in vis_type_xy plugin
7 participants