diff --git a/.github/scripts/diag_scatter_datatip.m b/.github/scripts/diag_scatter_datatip.m new file mode 100644 index 00000000..b9ac6d79 --- /dev/null +++ b/.github/scripts/diag_scatter_datatip.m @@ -0,0 +1,27 @@ +% Temporary diagnostic: default DataTipRows of a plain scatter and the +% hovertext plotlyfig derives from them (testSingleScatterPlotData) + +fprintf('MATLAB %s\n', version); +f = figure("Visible", "off"); +s = scatter(1, 1); +rows = s.DataTipTemplate.DataTipRows; +fprintf('%d DataTipRows\n', numel(rows)); +for k = 1:numel(rows) + v = rows(k).Value; + try + valueText = strjoin(string(v), " "); + catch + valueText = ''; + end + fprintf('row %d: Label=%s class(Value)=%s Value=%s\n', ... + k, rows(k).Label, class(v), valueText); +end + +p = plotlyfig(f, "visible", "off"); +if isfield(p.data{1}, "hovertext") + fprintf('hoverinfo: %s\n', string(p.data{1}.hoverinfo)); + fprintf('hovertext: %s\n', strjoin(string(p.data{1}.hovertext), " | ")); +else + disp('no hovertext'); +end +close(f); diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9f60e87..f56cae9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,11 @@ jobs: cache: true products: Statistics_and_Machine_Learning_Toolbox + - name: Diagnose scatter data tips + uses: matlab-actions/run-command@v3 + with: + command: addpath(genpath('plotly')); run('.github/scripts/diag_scatter_datatip.m'); + - name: Run plotly tests uses: matlab-actions/run-command@v3 env: