voyager icon indicating copy to clipboard operation
voyager copied to clipboard

UI for customizing constant value (for valuedef)

Open kanitw opened this issue 7 years ago • 2 comments

Model

  • [x] We need to make values of non-position channels in SpecificEncoding be ShelfFieldDef | ShelfValueDef. (For now declare, type ShelfValueDef = ValueDef; is sufficient.)

  • [x] Update toEncodingQuery, fromEncodingQuery

  • [x] This will involve some refactor throughout the projects as we need to add some type guards and some type checking since encoding's definition can be either a ShelfFieldDef or a ShelfValueDef.

Reducer

  • [x] SPEC_VALUE_CHANGE
  • [x] unit test

UI

  • [ ] popup -- add new ValueCustomizer component, taking FieldCustomizer as inspiration. (Or rename it to a single ChannelDefCustomizer if you think it is better to have only one component. I think two is better though.)

    • [ ] For each channel, you probably need different UI
      • color: Need a color picker
      • size, opacity: input slider with number? -- look at filter -- you may want to use the same component if possible. If not possible, make the style consistent.
      • shape: select box
      • text: free form text
      • detail: does not support value
    • PropertyEditor could be useful.
  • What to show in the UI if value is undefined

    • The UI should read VL default and always display something
    • [ ] First version could just say "auto"
    • [ ] Then Ham will help provide a method to read the default value of mark in VL
    • [ ] The model should have undefined stored -- so we don't have make reducer hairy (needing to replace empty field with default value.)

kanitw avatar Aug 24 '17 21:08 kanitw

Just noticed this vega example picks color like below.

vega pick color example

Not saying this is the way to go for Voyager, but I want to mark this example.

light-and-salt avatar Mar 02 '18 05:03 light-and-salt

Thanks, mac has native color picker that works pretty well. I don't know how it works in Linux / windows though. If there is a good standard, then we shouldn't reinvent the wheel. :)

kanitw avatar Mar 03 '18 17:03 kanitw