Skip to content

Allow passing defaults to marks via svelteplot/defaults #66

@gka

Description

@gka

Is your feature request related to a problem? Please describe.

see #59

Describe the solution you'd like

we want to be able to provide defaults on a mark level via the svelteplot/defaults context:

setContext('svelteplot/defaults', {
  line: {
    strokeWidth: 2
  },
  dot: {
    r: 4
  },
  graticule: {
    step: 10
  }
});

Some considerations:

  • The props would be itentical to the prop names exposed by the marks
  • We can re-use the typings exported by the Mark components
  • We should limit this to styling options and probably prevent users from setting defaults for positional channels like x, x1, y, or data etc

Please all note that this is a breaking change as we're going to rename some of the existing keys in svelteplot/defaults!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions