plot-grid icon indicating copy to clipboard operation
plot-grid copied to clipboard

2.0 todo

Open dy opened this issue 9 years ago • 3 comments

Current version seems to be insufficient due to the set of shortages.

  • [x] pan method, for faster reorientation, like time shift in gl-waveform. update is too large for that.
  • [x] zooming with auto(re)layout of lines, like thetamath
  • [ ] put axes with labels to a separate element, to easily adjust position for canvas grid no more actual
  • [x] adjustable position of axes, the value
  • [ ] symmetrical mode for log spanning over 0 use linear mode with custom lines
  • [x] style options, like color of lines/axes
  • [ ] dots style of rendering
  • [x] webgl version
  • [x] log grid fixes
    • [x] show 2/5 major lines in middle scales
      • [x] with subdivisions by 1/2/5
    • [x] limit range for very small scales, do not span over decade, it is too slow
    • [ ] add proper decibel lines placement use linear mode with custom lines placement
    • [ ] display units, with proper SI prefix, which could allow for avoiding 10² for a while use si-tools, human-format or other lib to format SI, place in format method
    • [x] group large scales as 1e0 1e+5 1e+10 ..., i. e. 1/2/5
    • [x] fix handing bug for very large scale, do clamping
    • [x] fix formatting of digits, ideally 10¹, 10², ... pretty-number can be used as such external package
    • [x] scale 10⁰ 10² 10⁴ has intermediate values of 10^1.5, ..., which have no sense
  • [x] add type property, setting up lines type from scratch: log, linear, time
  • [x] update pan-zoom to handle single callback
  • [ ] test negative directions, specifically negative log
  • [ ] add polar mode
  • [x] fix clipping axis labels placement bug
  • [ ] expand time type to Infinity
  • [x] API iteration, see below

dy avatar Oct 11 '16 16:10 dy

If we replace lines with smallLines and bigLines:

  • we don’t need custom formatter, because labels will play that role, instead of deciding on whether line is major or minor
  • we can replace ticks as a function with smallTicks and bigTicks size values, also we can easily disable small/big ticks separately
  • we can define smallColor and bigColor and avoid lineColor as a function
  • that plays well with dots style, we don’t need crosses style then - that will cover both of them

dy avatar Oct 27 '16 23:10 dy

What are possible approaches for 2 line types?

1. smallLines, bigLines (primary/secondary, major/minor)

− smallLines repeat bigLines, therefore colors overlap − we have to keep two line-generating methods with similar code

2. Create minor lines, detect/filter major lines

− we still get sort of 2 arrays with common lines, unless we splice small lines array

3. Create major lines, subdivide by minor lines (subdivisions phothoshop property)

− we gotta seriously refactor existing methods − not guaranteed it will be easier in result than generating small lines, as these line types are transitory (transform one to each other)

4. largeScale or scaleDiff, runs same routine for large lines

− still we get common lines. We can filter it by rendering large lines first. − very similar to list of coords x: [{}, {}]. Though we don’t duplicate methods, we keep things same. − potential danger of cases when minor lines do not go same steps as major ones. − it does not make sense if lines are array/object + we can redirect it to the first method, set largeLines repeat small lines with different scale. User may always redefine it then.

5. Keep code as is, just use isMajor filtering

− colors are unbound from defaults − unable to customize labels formatting without losing small/big lines − not easy to change small lines color, behaviour like "if you don’t like me as I am, do it by yourself without me" − unable to change small ticks size without copy-pasting the code

(in general, it is when we try to put complicated things in not suitable API)

dy avatar Oct 29 '16 15:10 dy

Sh*t, it appears that lines & sublines create more complexity, limitations and bad code that single lines pipeline.

  • we can’t easily draw some custom lines, like xy-pad, some intermediate line like number π, and define it’s color. Especially that sucks for custom ticks, because it is not that easy to delegate that to user.
  • drawCoordinate method is mess and there is no way to make it better
  • ticks may want own steps, different from big lines (see thetamath). And we can’t have common stops list to make correspondance of ticks
  • we have to filter sublines for uniqueness, which is O(N)

So, what is the middle way?

Sublines are still the best solution for dots, and nice subtle addition to the config, user can safely skip them and work with main lines. For thetamath case we can just inverse sublines and lines by meaning.

Mb call them differently to unbind from sub meaning?

  • extralines, hyperlines, interlines, postlines, ultralines

dy avatar Oct 30 '16 01:10 dy