-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Lens] Mosaic / mekko vis type #117668
[Lens] Mosaic / mekko vis type #117668
Conversation
Pinging @elastic/kibana-vis-editors (Team:VisEditors) |
@alexwizp @ghudgins As we discussed via chat, one thing we could to do to make it more obvious to the user there need to be two "slicing" dimensions is to create different groups for the two dimensions. Right now IMHO it looks a bit weird to have a dimension group with a dimension and it still says "Required" in red. |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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 won't approve yet because it will probably have some changes about the dimension groups.
The code looks good and I tested it on Chrome and works fine. There is one thing though that might be to reconsider, not introduced in this PR, but related. When having a date histogram and switching between any pie type charts, I don't think we should remove the date histogram. We should remove it when switching between xy chart -> pie, but not pie -> donut. @ghudgins @MichaelMarcialis WDYT?
x-pack/plugins/lens/public/types.ts
Outdated
@@ -470,6 +470,7 @@ export type VisualizationDimensionGroupConfig = SharedDimensionProps & { | |||
supportsMoreColumns: boolean; | |||
/** If required, a warning will appear if accessors are empty */ | |||
required?: boolean; | |||
minDimensions?: number; |
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.
seeing the comment from Joe, this will probably change? If for some reason it would still be here(for example, we'd decide to change the messaging instead from Required dimension
to Required 2 dimensions
) , I wonder if it would make sense to combine it with required
as requiredMinDimensionCount
... Or something shorter 😅 That would require changes for all vises.
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.
agree @mbondyra - the stripping of date histogram seems to make the most sense only from XY --> Partition chart type (and not between the partition chart types)
@elasticmachine merge upstream |
I agree with your thinking here, @mbondyra. In the case of your second transition example, I imagine the date histogram dimension should remain as a second dimension to the mosaic chart, thus avoiding the error message entirely. |
Great work in this PR 🎉 Here's a sortPredicate: ([name1, node1]: ArrayEntry, [name2, node2]: ArrayEntry) => {
if (name1 < name2) return -1;
if (name2 < name1) return 1;
// otherwise, use the increasing value order
return node1.value - node2.value;
} or the briefer, identical sortPredicate: ([name1, node1]: ArrayEntry, [name2, node2]: ArrayEntry) =>
name1 < name2 ? -1 : name1 > name2 ? 1 : node1.value - node2.value |
@ghudgins I've created a separate issue cause I see similar problem with all If we want to implement sorting only for @flash1293 fyi |
it might just because of the styling but I more want to sort mosaic's first dimension than I would on the others. sounds good either way (in this issue or otherwise) but I think it'll come up if we don't fix it. all the more reason to not forget that |
# Conflicts: # x-pack/plugins/translations/translations/ja-JP.json # x-pack/plugins/translations/translations/zh-CN.json
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.
XY transitioning
I have some questions about transitions to/from XY -> Mosaic.
Say I have this XY chart defined with Top value of extension.keyword
Horizontal categories, with Break down by Top values of clientip
:
When switching to Mosaic
the two dimensions gets mapped into Group by
with the dimension Top values of clientip
(previous Break down by) as inner grouping dimension here.
But if I swap the two dimension in XY and do the same transition, Top values of clientip
is still set as inner grouping dimension:
Labels inside or outside?
What does it means in Mosaic context Inside
and Outside
? To be positions look fixed, no?
Left also a couple of minor nitpicks.
Probably the labels is the one more important to address, as for the transition it would be nice to have it fixed but we had already similar issues afaik.
Not sure whether the xy transition can be easily fixed in the current code structure. As Alexey noticed this is a difficult area to work with at the moment. I would be totally fine with leaving it in the current state as the nesting is easy to change in mosaic. |
No strong opinion on the transition one. The labels one looks more confusing. |
@elasticmachine merge upstream |
The label position has been reworked to show now a classic It would make more sense, in my opinion, removing completely the What do you think @alexwizp , @flash1293, @markov00, @ghudgins ? |
No strong opinion on this one, but I think I agree with you here @dej611 - I can't think of any use cases where people would want to hide the outer labels. |
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.
Reviewed locally in Safari with latest changes 👍
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @alexwizp |
* [Lens] Mosaic / mekko vis type Closes: #104223 * some updates * fix color palette logic * fix suggestions * fix JEST * fix some parts * update labels * Fix JEST * add showExperimentalBadge * add sorting * fix toolbar options * fix Marco suggestion Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Lens] Mosaic / mekko vis type Closes: elastic#104223 * some updates * fix color palette logic * fix suggestions * fix JEST * fix some parts * update labels * Fix JEST * add showExperimentalBadge * add sorting * fix toolbar options * fix Marco suggestion Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Closes: #104223
Summary
Expose mosaic from charts in
Lens
for all the great reasons in the charts PR: elastic/elastic-charts#1113Screens
chart:
suggestions:
validation: