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

Allow greater control over layer rendering order #674

Closed
nickofthyme opened this issue May 12, 2020 · 2 comments
Closed

Allow greater control over layer rendering order #674

nickofthyme opened this issue May 12, 2020 · 2 comments
Labels
:chart Chart element related issue enhancement New feature or request :specs Chart specifications related issue :xy Bar/Line/Area chart related

Comments

@nickofthyme
Copy link
Collaborator

Feature

Allower greater control over the layer rendering order on canvas layers. Should sync with legend and tooltip order somehow.

Proposed API

Very rough idea right now to start thinking about the best approach

// Render ordering
interface OrderFn = (series: SeriesIdentifier) => number; // number to use as global z-index
interface OrderSortFn = (seriesA: SeriesIdentifier, seriesB: SeriesIdentifier) => -1 | 0 | 1; // relative ordering of series
type Order = OrderFn | OrderSortFn | number // number would be the simplest ordering or spec
interface BasicSeriesSpec {
  order: Order;
}

// Edge clippings
interface EdgeClippingProps {
  lineWidth?: boolean; // including line width on edge
  points?: boolean; // including point radius on edge
  highlighter?: boolean; // include all highlighter elements outside of chart area
  padding?: number; // max padding for clippings
}
interface SettingsSpec {
  // not sure if Settings is the right place for this but it should be a global thing
  edgeClipping: EdgeClippingProps;
  ...
}

Related to #315, #303, #585 & #160

Examples

Overall ordering

Order rendering per spec, based on simple number or order.

Series ordering

Order rendering per series, overriding spec order. For example, select which line gets drawn on top of the other.

image

Edge clipping

Greater control for clipping at the edge for line widths and points

Image 2020-05-12 at 11 57 03 AM

@nickofthyme nickofthyme added enhancement New feature or request :chart Chart element related issue :specs Chart specifications related issue labels May 12, 2020
@markov00 markov00 added the :xy Bar/Line/Area chart related label May 29, 2020
@markov00 markov00 added this to the Kibana 7.11 milestone Aug 26, 2020
@markov00 markov00 mentioned this issue Oct 7, 2020
4 tasks
@markov00 markov00 removed this from the Kibana 7.11 milestone May 26, 2021
@markov00
Copy link
Member

@nickofthyme do you think we can close this for now? does the new rendering sorting mechanism solves the request here?

@nickofthyme
Copy link
Collaborator Author

Yeah, I don't know why I grouped sorting with the edge clipping, I think that issue still stands but we can address that in a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:chart Chart element related issue enhancement New feature or request :specs Chart specifications related issue :xy Bar/Line/Area chart related
Projects
None yet
Development

No branches or pull requests

2 participants