Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-10462

Adapt scatter plot for multi-trace chart architecture with Plotly.js

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: Firefly
    • Labels:

      Description

      Adapt scatter plot and/or density plot to work within the design frame described in DM-9945.
      This will be the start of plotting multiple 2D traces (series) within one chart space.

        Attachments

          Issue Links

            Activity

            No builds found.
            xiuqin Xiuqin Wu [X] (Inactive) created issue -
            xiuqin Xiuqin Wu [X] (Inactive) made changes -
            Field Original Value New Value
            Link This issue relates to DM-9945 [ DM-9945 ]
            xiuqin Xiuqin Wu [X] (Inactive) made changes -
            Epic Link DM-6281 [ 24802 ]
            xiuqin Xiuqin Wu [X] (Inactive) made changes -
            Link This issue relates to DM-5764 [ DM-5764 ]
            xiuqin Xiuqin Wu [X] (Inactive) made changes -
            Link This issue relates to DM-4585 [ DM-4585 ]
            tatianag Tatiana Goldina made changes -
            Status To Do [ 10001 ] In Progress [ 3 ]
            tatianag Tatiana Goldina made changes -
            Summary adapt scatter plot within the new container frame using Plotly.js Adapt scatter plot for multi-trace chart architecture with Plotly.js
            tatianag Tatiana Goldina made changes -
            Reviewers Loi Ly [ loi ]
            Status In Progress [ 3 ] In Review [ 10004 ]
            Hide
            tatianag Tatiana Goldina added a comment -

            https://github.com/Caltech-IPAC/firefly/pull/391

            TODO:

            • Optimize chart updates. Currently, new plot is created on every update, since we just change layout and data and do not use layoutUpdate, dataUpdate, dataUpdateTraces of PlotlyWrapper. Since our layout is shared with Plotly, all layout update changes will be reflected in layout object. As for the data, we don’t store SELECTED and HIGHLIGHTED traces, but create and append them to the end of the data array dynamically. At the very least, we need optimize highlight/selection rendering.
            • Table connection for Histogram and Heatmap
            • Options of each plotly type (ScatterOptions, FireflyHeatmapOptions, FireflyHistogramOptions). May be the easiest way to do it is to create an outer component which maps plotly data/layout properties to current options object and back.
            • Error handling: errors from the table or when fetching chart data should be displayed to the user.
            • Connecting to new options to chart dropdown.
            • Expanding any multi-chart component in API (similar to the default one in triview)
            • Optimization: don’t update chart data of an unmounted chart, update on chart mount
            • Default chart options: plot catalog cols or first two cols
            • Separating firefly specific things from plotly trace data
            • Not storing fetchData function in tablesource (though I realized that tablesource._cancel is also a function)

            Bugs to fix:

            • Removing selection box when user clicks anywhere on the chart. Q: how can we remove just the selection box? (The workaround I use in XYPlotPlotly is chartDiv.d3.selectAll('.select-outline').remove().
            • Formatting tooltips for expressions: avoid displaying all sig digits - get min-max and save 4 sig digits in difference

            Discussion items:

            • Related to the first missing item: How to optimise chart updates? What chart updates should be optimized? (Highlight and select for sure, attribute changes for a single trace, layout changes..) What part of code should be doing the optimization? (Probably action creator for CHART_UPDATE, because it gets “changes”)
            • Should we keep relying on Plotly chartDiv.data for the details of SELECTED and HIGHLIGHTED traces? (plotly_onclick currently returns only the topmost point)
            • Where to store trace and layout parameters, which are not mapping directly to Plotly attributes? These can be parameters used to fetch the derived data or the default boundaries, which are not exactly the range of the axes, because the range is changing. (I store in data[traceNum].firefly and layout.firefly for now.)
            • Related: how do we know that the trace will have a custom table source. (I use data[traceNum].firefly.chartType parameter.)
            • Related: where should we store an array of rowIdx to connect chart points to table rows? (I store it in data[traceNum].firefly.rowIdx - which SELECTED and HIGHLIGHTED traces to include the correct rowIdx into the trace data.
            • Should we try our best to match option parameters to Plotly data or layout attribute path or rely on a wrapper component to do the mapping from chart option fields to Plotly data/layout and back. (To make UI more flexible)
            Show
            tatianag Tatiana Goldina added a comment - https://github.com/Caltech-IPAC/firefly/pull/391 TODO: Optimize chart updates. Currently, new plot is created on every update, since we just change layout and data and do not use layoutUpdate, dataUpdate, dataUpdateTraces of PlotlyWrapper. Since our layout is shared with Plotly, all layout update changes will be reflected in layout object. As for the data, we don’t store SELECTED and HIGHLIGHTED traces, but create and append them to the end of the data array dynamically. At the very least, we need optimize highlight/selection rendering. Table connection for Histogram and Heatmap Options of each plotly type (ScatterOptions, FireflyHeatmapOptions, FireflyHistogramOptions). May be the easiest way to do it is to create an outer component which maps plotly data/layout properties to current options object and back. Error handling: errors from the table or when fetching chart data should be displayed to the user. Connecting to new options to chart dropdown. Expanding any multi-chart component in API (similar to the default one in triview) Optimization: don’t update chart data of an unmounted chart, update on chart mount Default chart options: plot catalog cols or first two cols Separating firefly specific things from plotly trace data Not storing fetchData function in tablesource (though I realized that tablesource._cancel is also a function) Bugs to fix: Removing selection box when user clicks anywhere on the chart. Q: how can we remove just the selection box? (The workaround I use in XYPlotPlotly is chartDiv.d3.selectAll('.select-outline').remove(). Formatting tooltips for expressions: avoid displaying all sig digits - get min-max and save 4 sig digits in difference Discussion items: Related to the first missing item: How to optimise chart updates? What chart updates should be optimized? (Highlight and select for sure, attribute changes for a single trace, layout changes..) What part of code should be doing the optimization? (Probably action creator for CHART_UPDATE, because it gets “changes”) Should we keep relying on Plotly chartDiv.data for the details of SELECTED and HIGHLIGHTED traces? (plotly_onclick currently returns only the topmost point) Where to store trace and layout parameters, which are not mapping directly to Plotly attributes? These can be parameters used to fetch the derived data or the default boundaries, which are not exactly the range of the axes, because the range is changing. (I store in data [traceNum] .firefly and layout.firefly for now.) Related: how do we know that the trace will have a custom table source. (I use data [traceNum] .firefly.chartType parameter.) Related: where should we store an array of rowIdx to connect chart points to table rows? (I store it in data [traceNum] .firefly.rowIdx - which SELECTED and HIGHLIGHTED traces to include the correct rowIdx into the trace data. Should we try our best to match option parameters to Plotly data or layout attribute path or rely on a wrapper component to do the mapping from chart option fields to Plotly data/layout and back. (To make UI more flexible)
            tatianag Tatiana Goldina made changes -
            Resolution Done [ 10000 ]
            Status In Review [ 10004 ] Done [ 10002 ]

              People

              Assignee:
              tatianag Tatiana Goldina
              Reporter:
              xiuqin Xiuqin Wu [X] (Inactive)
              Reviewers:
              Loi Ly
              Watchers:
              Loi Ly, Tatiana Goldina, Xiuqin Wu [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.