Skip to content

Migrate ScatterPlot to PureScript; fix xAxis tickSizeOuter#1524

Merged
rolyp merged 9 commits into
fluid-0.13from
1160-scatterplot-migration
Apr 14, 2026
Merged

Migrate ScatterPlot to PureScript; fix xAxis tickSizeOuter#1524
rolyp merged 9 commits into
fluid-0.13from
1160-scatterplot-migration

Conversation

@rolyp
Copy link
Copy Markdown
Collaborator

@rolyp rolyp commented Apr 13, 2026

Summary

  • Migrates ScatterPlot.setSelection and createElement to PureScript, deleting ScatterPlot.js entirely
  • Adds numericXAxis/numericYAxis foreigners to shared D3 module for auto-tick numeric axes
  • Extracts scale creation to PureScript using D3.scaleLinear
  • Fixes xAxis missing tickSizeOuter(0), making all four axis functions consistent

Test plan

  • energy-scatter: 10 points render, default radius, hover/click selection, cross-selection to data pane
  • renewables-linked: bar chart x-axis outer tick caps removed (visual)
  • Full article test suite passes on Chrome and Firefox

🤖 Generated with Claude Code

rolyp and others added 7 commits April 13, 2026 15:45
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…, zero-before-interaction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…remains in JS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…near

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…Axis/numericYAxis

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…/numericYAxis

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merge App.Util (classes) into existing App.Util import; remove unused
UIHelpers/uiHelpers from App.View.Util and unused Select. Surfaced by
CI's prod build under --strict.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread fluid/src/App/View/ScatterPlot.purs Outdated
, "y" ⟼ height + 25
, "style" ↦ "text-anchor: end; font-size: 10px"
]
>>= setText (contents lx)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

labels.x might be clearer here

Comment thread fluid/src/App/View/ScatterPlot.purs Outdated
, "y" ⟼ negate margin.left + 20
, "style" ↦ "text-anchor: end; font-size: 10px"
]
>>= setText (contents ly)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Comment thread fluid/src/App/View/ScatterPlot.purs Outdated
, classes [ "center" ]
]
rootElement <- svg # create G
[ "transform" ↦ ("translate(" <> show margin.left <> ", " <> show margin.top <> ")") ]
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have helpers anywhere that construct translate specifications? (Not suggesting we necessarily need one, but let's if there is something already, or whether the pattern recurs elsewhere.)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rolyp
Copy link
Copy Markdown
Collaborator Author

rolyp commented Apr 14, 2026

Addressed in aaee5ae:

  • L61: now uses the existing translate helper from App.View.Util.D3 (translate { x: margin.left, y: margin.top }). Same helper is used by BarChart, LineChart, and the new renderAxes in this PR.
  • L76/84: replaced Point { x: lx, y: ly } = labels destructure with inline (unwrap labels).x / .y, consistent with (unwrap …).field pattern used in BarChart and LineChart.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rolyp rolyp merged commit 5a97cd2 into fluid-0.13 Apr 14, 2026
6 checks passed
@rolyp rolyp deleted the 1160-scatterplot-migration branch April 14, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant