Summary
Replace hardcoded _setup(893, 1117) magic numbers with configurable ARFset constructor options
Environment
- Product/Service: FeatureSET-Display — JavaScript API
- File:
src/ARFset.js:249-251
Problem Description
The ARFset constructor calls _setup(893, 1117) with hardcoded canvas dimensions. These magic numbers are undocumented, cannot be overridden by callers, and do not reflect real use-case canvas sizes. Any application needing a different canvas size must patch the source.
Expected Behavior
The ARFset constructor accepts an optional { width, height } options object with sensible defaults (e.g. { width: 893, height: 1117 } to maintain existing behavior). Callers can override dimensions without modifying the library.
Actual Behavior
Canvas dimensions are hardcoded in the constructor; no way for callers to specify a different size.
Tasks
Impact
Low — Usability improvement; no functional regression. Current defaults preserve existing behavior.
Additional Context
This is a non-breaking change if defaults match current hardcoded values (893 × 1117). Consider also accepting a single canvas element reference as an alternative constructor signature to read dimensions from the DOM element directly.
Summary
Replace hardcoded
_setup(893, 1117)magic numbers with configurableARFsetconstructor optionsEnvironment
src/ARFset.js:249-251Problem Description
The
ARFsetconstructor calls_setup(893, 1117)with hardcoded canvas dimensions. These magic numbers are undocumented, cannot be overridden by callers, and do not reflect real use-case canvas sizes. Any application needing a different canvas size must patch the source.Expected Behavior
The
ARFsetconstructor accepts an optional{ width, height }options object with sensible defaults (e.g.{ width: 893, height: 1117 }to maintain existing behavior). Callers can override dimensions without modifying the library.Actual Behavior
Canvas dimensions are hardcoded in the constructor; no way for callers to specify a different size.
Tasks
{ width, height }in theARFsetconstructor with defaults matching current hardcoded values_setup(width, height)example/example.html,example_es6.html) to explicitly pass dimensions or rely on defaultsImpact
Low — Usability improvement; no functional regression. Current defaults preserve existing behavior.
Additional Context
This is a non-breaking change if defaults match current hardcoded values (893 × 1117). Consider also accepting a single
canvaselement reference as an alternative constructor signature to read dimensions from the DOM element directly.