Skip to content

useImage hook throws an error in data.getRaster when image selection is changed #13

@xinaesthete

Description

@xinaesthete

I'd mostly ignored this as it seemed to not have any major detrimental effect beyond a console.error being logged - but I think when embedded in docusaurus it presents a large "Uncaught runtime errors" overlay.

Note that MDV doesn't have an error when doing similar image switching (and pretty sure Avivator doesn't either). In MDV, the way it works when changing via chart settings GUI is that the config.region value is mutated, which eventually surfaces via useImgUrl() / useRegion() and mobx observing that mutation... Not entirely sure what is wrong about the element/loader changing logic here but essentially when we

  const source = useViewerStore((state) => state.source);
  useImage(source);

That seems to be using an empty source before loader is quite ready yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions