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

Crash combining exclude and mark-level faceting #1198

Closed
mbostock opened this issue Dec 27, 2022 · 0 comments · Fixed by #1197
Closed

Crash combining exclude and mark-level faceting #1198

mbostock opened this issue Dec 27, 2022 · 0 comments · Fixed by #1197
Labels
bug Something isn’t working

Comments

@mbostock
Copy link
Member

The Plot.text mark here crashes:

Plot.plot({
  height: 600,
  grid: true,
  facet: {
    data: penguins,
    x: "sex",
    y: "species",
    marginRight: 80
  },
  marks: [
    Plot.frame(),
    Plot.dot(penguins, {facet: "exclude", x: "culmen_depth_mm", y: "culmen_length_mm", r: 2, fill: "#ddd"}),
    Plot.dot(penguins, {x: "culmen_depth_mm", y: "culmen_length_mm"}),
    Plot.text(d3.union(penguins.map((d) => d.sex)), {fx: (d) => d, x: null, fill: "red"})
  ]
})

The crash occurs computing excludeIndex because the index is sparse, containing undefined entries:

Screenshot 2022-12-26 at 5 11 56 PM

@mbostock mbostock added the bug Something isn’t working label Dec 27, 2022
@mbostock mbostock mentioned this issue Dec 27, 2022
36 tasks
mbostock added a commit that referenced this issue Dec 27, 2022
chaichontat pushed a commit to chaichontat/plot that referenced this issue Jan 14, 2024
* axis mark

* deferred channels

* vector tick

* tickPadding

* grid

* grid

* no rounded stroke

* fix half-pixel offset

* more conditional axes

* grid mark

* DRY tick

* tick[XY]

* explicit ticks

* axisTick[XY]

* axis mark data

* axis insets

* tickFormat

* better default tick format

* simpler inferTickFormat

* auto ticks; expose scale.interval

* anchor

* manual axis label, for now

* tickRotate

* fix crash in sparse excludeIndex

* facetAnchor; fix mark-level missing facet

* simpler facet sorting

* fix observablehq#522; better facetAnchor

* fix observablehq#1198; better empty facets

* fix for ordinal scales

* soft hyphen

* test label wrapping

* facet grid

* better facet grid

* better facet grid, again

* better grid

* better facet axes; fix font variant

* extract facetSkip

* empty facets

* destructure options

* remove redundant defaults

* fix tickPadding, tickRotate

* better grid defaults

* more empty facets

* simpler facet warning

* decoration

* better empty facets

* better facet sort

* extract facetAnchor

* extract more facet logic

* const facets

* unify code

* more facet anchors

* invert facetAnchor

* checkpoint axis label

* checkpoint axis mark integration

* fix minimum offset margin

* fix for null marks and scales

* better implicit axes

* denote side-effect

* better axis options

* implicit facet axes

* more implicit axis options

* inferAxes

* delete old axes

* minimize diff

* fix default margins

* remove mark.decoration

* facet margin options

* move side effect

* inheritScaleLabels

* remove comment

* better ARIA labels; restore prior axis order

* regenerate tests; smarter partial implicit axes

* more smarter partial implicit axes

* axis line

* text stroke options

* don’t inline text elements

* do inline title elements

* axis label

* fix axes for interval scales

* gridDasharray

* better implicit axis

* x-axis label

* another fancy axis example

* polish example

* fancy multi-line time ticks

* another fancy axis example

* remove secondary grid shorthand

* tweak y-axis label position

* first stab at documentation

* the grid doesn't follow anchor

* better deferred channels

* better explicit built-in axes

* fix metroUnemploymentRidgeline test

* use insetTop for better semantics

* fix label option inheritance

* axis = both

* fix comment

* a few fixes to axis label position

* labelAnchor

* smarter default labelAnchor

* fix googleTrendsRidgeline

* fix longLabels

* non-fix for named time intervals

* fix projectionHeightGeometry

* non-fix for x-axis label position

* better axis label position

* inset axis label

* fix observablehq#375; respect facet margins

* fix industryUnemploymentTrack

* restore grid in penguinCulmen

* facet margin collapse

* better facet margin collapse

* drop comment

* labelOffset

* fix auto labels and arrows

* named exports for tests

* enable facet axis labels

* add non-faceted athletesSample test

* better facet axis label position

* cleaner

* enforce constant tick options

* shorter athletesSportWeight

* remove dead code

* checkpoint cross-facet marks

* checkpoint supermarks

* super option

* better super marks

* drop unused mid facet anchors

* disallow superposition, for now

* facet = super

* minimize diff

* fix axis label position, finally?

* better hexbin tests

* polish tests

* fix named time intervals for ticks

* grid xy shorthand

* consistent scale checks

* better axis options

* tickSpacing option

* propagate tickSpacing option

* fix off-by-one with interval ticks

* typo (thanks, @yurivish!)

* only one label for both axes

* a bit of documentation for axisX

* given data, don’t defer channels

* reduce aaplCloseDataTicks test

* implicit grid with explicit axis

* more grid shorthand

* Update README

* fix default facet axis anchor

* axis plot shorthand

* Update README

---------

Co-authored-by: Philippe Rivière <fil@rezo.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant