plottable
plottable copied to clipboard
Line chart entity selection is `undefined`
it seems like line chart is composed of 2 entity, and after upgrading to plottable 3.x we realized that the second entity selection object is kind of broken: entity.selection._groups[0][0]
is undefined
this is probably caused by getVisualPrimitives()
https://github.com/palantir/plottable/blob/develop/src/drawers/drawer.ts#L99 only returns [Path]
(size of 1) and when we convert entity to plottable entity we index into the visual primitives array with the entity index (entity is size of 2)
https://github.com/palantir/plottable/blob/dce44f17ecdec81a1598bee7bf9884a08a0acd36/src/plots/plot.ts#L746 (first introduce in https://github.com/palantir/plottable/pull/3304)
for more detail:
selection for entity 1 for a line:
selection for entity 2 for a line:
not sure what the previous state was...
Spoke offline, the root cause is that line drawer is returning empty selections. This is probably because Line constructs only one visual primitive per dataset, but goes through the "one visual primitive per data point" code path