here's (fiddle or gist you can paste into vega editor) a vega-lite project i'm working on. it's an interactive map of zip codes that lets you view a timeline of covid infections.
the color and y-scale are symlog, but that overemphasizes some rare negative values in the dataset (i guess when the health department reverses previously declared positive cases).
i'd like to use a piecewise scale to give less magnification to negative values.  but when i add the following to my y-encoding scale, it seems to collapse the data to a single y value.
{ "domain": [-0.2 , 0, 1.4]
, "range" : [-0.05, 0, 1.4]
}
so what's the right way to specify a piecewise scale?
a few other questions i have:
- the selection colors for each zip are currently chosen as nominalsinebowentries by zip, but since zip codes are spatially correlated, selecting nearby zip codes yields unhelpfully similarly colored lines (green in the example above). i think it would be better to use n equally spacedsinebowentries for n selections, but how can these be computed at selection time?
- is there any way to include the Line'spointjust when it is selected (not just using selection-dependentopacityorsize), rather than including a separateCircleMarklayerfiltered to the selection, as i have done? like setting theshapeencodingtonullor something?
- is there any way to get a tooltipalong theLines, not just at datapoints? i see it would be ambiguous which point's data to inspect, but i would thinkLines should address this.
- looks like choropleth zoom+pan has been deferred for a couple years, even though vegacan do it. what makes this so hard forvega-liteto pick up? are there any workarounds? i would consider switching tovega(also for new labeling support that's not yet invega-lite), but what is the best way to do this? i happen to usehvegainhaskellto generate myvega-liteand would rather continue to maintain as much as possible from there, is it possible to avoid switching to doing everything invega, only using it whenvega-liteis insufficient? i'm picturing something like avegainstruction toimport from vega-lite...

