Skip to content

[BUG] Individual domains on plots and storybook #182

@eskildht

Description

@eskildht

Describe the bug
In version 0.8.0 I can't set individual domains on LinePlots in the same GraphTrack. It works in version 0.7.3.

EDIT: After testing a bit it seems to me that the domain is set correctly, but the graphLegendConfig does not keep up per plot in version 0.8.0.

Additional secondary issue
The storybook when checking HEAD on dev fails to properly render. That is, everything under Log Controller and Log Viewer. The storybook works fine if checking out 0.7.3 or 228b76d. Currently it looks like this:

sss.mov

To Reproduce (primary issue)
Steps to reproduce the behavior:

  1. Do as below (picked from stories) having the necessary imports and ex2 initialized to some data:
export const logControllerLegend = () => {
  const div = document.createElement('div');

  const logController = new LogController();

  const tracks = [new GraphTrack(3, {
      label: 'Some noise',
      abbr: 'noise',
      data: ex2,
      legendConfig: graphLegendConfig,
      plots: [{
        id: 'noise',
        type: 'line',
        options: {
          color: 'blue',
          filterToScale: false,
          dataAccessor: d => d.noise,
          legendInfo: () => ({
            label: 'Plot1',
            unit: 'mm',
          }),
        },
      }, {
        id: 'more_noise',
        type: 'linestep',
        options: {
          scale: 'linear',
          domain: [0, 40],
          color: 'black',
          offset: 0.5,
          dataAccessor: d => d.noise2,
          legendInfo: () => ({
            label: 'Plot2',
            unit: 'Pwr',
          }),
        },
      }],
    }),
  ]

  // Using requestAnimationFrame to ensure that the div is attached
  // to the DOM before calling init
  requestAnimationFrame(() => {
    logController
      .init(div)
      .setTracks(tracks);
  });

  return div;
  1. See that domain rendered on is [0, 100] for both plots (EDIT: according to graphLegendConfig).

Expected behaviour (primary issue)
Plot1 should render on [0, 100]. Plot2 should render on [0, 40].

Desktop (please complete the following information):

  • OS: macOS Ventura 13.0.1
  • Browser: chrome 107.0.5304.110 (Official Build) (arm64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions