-
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
[Lens] API for Styling Lens Embeddables #69349
Comments
Pinging @elastic/kibana-canvas (Team:Canvas) |
Pinging @elastic/kibana-app (Team:KibanaApp) |
There is no generic "dark mode" flag, will something like this just be done with the detailed color settings? I wonder whether we can distill this list into a typescript interface and make it part of the expression context like the "searchContext". This way visualize can integrate with it as well (I guess Canvas has the same requirements there). cc @ppisljar |
I'm concerned about defining an API that ignores the visualization subtypes, and is trying to be too broad- is it possible that what we actually want is a "Lens styling editor" which can be configured differently for the XY charts, pie charts, tables, etc? |
i agree with @wylieconlon proposal. in canvas visualizations will have arguments that allow you to override the default sytling, for example then of course editor needs to be registered with canvas for every function, which would expose the ui to configure this. we are not providing canvas ui's for our chart functions, but canvas team could definitively implement them, and i would suggest to do so if you find yourself in need of a chart that we support (for example tagcloud ?). so i think lens team should do the same, xy_chart function should have What I think would be very valuable (and this issue is the start of it) is to start listing things that are common across different functions/charts in our teams and start aligning on those. for example lets all use the same Clint's list is a good start, but i think its important that we don't just list those, but add a function (existing or a link to an issue describing it) that you should use and the argument name and type. for example:
|
@ppisljar I'm not sure I see it in your proposal above, so I want to clarify: the way that Canvas is using both Lens and Visualize charts is using the Embeddable API, through a custom wrapper function. Nothing in our current APIs would let the Canvas editor distinguish between a "Lens pie chart" and "Lens table", or "Visualize pie chart" and "Visualize table"- because the only thing available is the ID of the saved object. Do you see the problem, and do you have a proposed solution? I would expect two possible solutions:
|
my proposal is that canvas uses expression functions direclty. Its fine that there is a way to add embeddable, but if embeddable is based on expression canvas should allow you to "inline" the embeddable, basically replacing embeddable with actual expression powering it. This is when canvas users would get full control over pallets, fonts, all the settings pretty much. when using embeddables, i am not sure we can really do something for "all the embeddables". it will be hard to enforce all embeddables are using some parameters passed on the input, also we probably want a fallback in case the parameters are not provided. Currently color pallete is something that is configured on the chart level and its different for every chart. Most likely also those settings won't make sense for every chart, and i guess users will be confused if they are setting the color pallete (in canvas) and the chart doesnt change (either because we forgot to use that input or because its irrelevant .... for example in table chart) |
@wylieconlon While a provided UI is useful, it won't be everything Canvas needs. We'll want to default colors/font/etc programmatically as well as provide one-off customization to the user. @ppisljar We shouldn't limit this to the realm of expressions, (e.g. "we'll place a parameter in the expression"). I agree that having these customizations there is useful as well as germane... but we can't discount programmatic customization. I think we can get around this with my forthcoming proposal on defaulting in Expressions. But I hope we can find a great way to pass styling/theming through an embeddable to a Lens/Chart renderable easily. |
@ppisljar Your proposal of using the Lens functions directly is not something that I'm comfortable doing until we are GA, because we intend to change the API soon. The same goes for Visualize: we should find a solution that lets us style the embeddable from the outside. @clintandrewhall If we don't provide an editor for use by apps like Canvas, then Canvas will have to provide the same kind of styling options for all Lens visualizations. I think it will be a better user experience with a UI that is able to understand the type of visualization. |
@wylieconlon I'm not arguing against a UI. I'm saying I'd prefer it not be the only avenue of styling Lens visualizations. If a user has 10 Lens viz on a Canvas workpad, I don't want them having to style each one individually because Canvas has no way to manipulate it programmatically. |
Related visualization issue: #2207 |
I am closing this as work for canvas has been deprioritized. We are in discussions on allowing styling changes as fonts etch but we are tracking them on different issues |
Canvas now supports Lens Embeddables. We'd like to work with the Lens team to define and utilize an API for altering various visual attributes of a visualization from our context.
Background
Canvas allows users to define their own CSS style definitions for any Canvas element. This flexibility has made Canvas easier to customize. While we don't expect Lens visualizations to duplicate these granular levels of style flexibility, as Lens approaches GA and visualizations are added to Canvas workpads, the expectation of being able to customize at least some parts of the visualization will be there.
This is something we may be able to leverage in Elastic Charts or other HTML-based embeddables. We're currently exploring options.
Feature Request
While this list may not be exhaustive, we'd like Lens Embeddables to support changing the following attributes:
label
,heading
,primary
orsecondary
-- which can customize the above. Viz likeMetric
might have primary and secondary, for example.We can certainly update/flesh out this list as the conversation proceeds. Thanks!
The text was updated successfully, but these errors were encountered: