influxdata / influxdata/giraffe

Ticks generator: allow tick marks to be generated with a function

Open
#483 1 comment 0 reactions 0 assignees View on GitHub
kind/feature request team/ui
Dominant language
TypeScript
Stars
189
Forks
33
Avg merge
3d 15h
Merged PRs (30d)
4

Description

Currently, axis ticks can be specified with an array in the configuration properties.

As a user, if I want to generate tick marks dynamically based on the domain (or some other properties), then I would have to do this within my own app and update the array as needed. It would be easier if Giraffe could do all of the heavy lifting and allow the use of a callback function to generate the ticks. Giraffe's role would be to validate the result of this function and have a sensible fallback.

This callback function should be given access to the domain and also several of the other tick-related properties. Ideally, the callback function should have access to:
- domain
- total ticks option
- tick step option
- tick interval option
- scaling function (the **_actual_** function itself and not just the string "log" or "linear")

This callback function always returns an array of tick marks, similar to the ticks array option. When both are present, the function should override and take precedence.

The biggest use case for this feature is in logarithmic scale because:
- tick marks for logarithmic scale can vary widely, based on what the user is trying to see with the visualization
- the existing tick step option is linear and does not handle logarithmic scale
- the default tick marks generated by Giraffe are unappealing: its logic/pattern is opaque and hard to understand and it chooses tick marks at seemingly strange values

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by locating the tick configuration and tick-generation entry points, then trace how domains, tick options, and scaling functions are available. Define the callback contract, validation and fallback behavior, and precedence over the ticks array; done means logarithmic and other dynamic tick cases are covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.