Skip to content

feat: add per-entity logarithmic override#1348

Open
mxr wants to merge 1 commit intokalkih:devfrom
mxr:entity-logarithmic-axis
Open

feat: add per-entity logarithmic override#1348
mxr wants to merge 1 commit intokalkih:devfrom
mxr:entity-logarithmic-axis

Conversation

@mxr
Copy link
Contributor

@mxr mxr commented Mar 9, 2026

Adds per-entity logarithmic configuration so mixed-scale graphs work correctly.

Specifying 'secondary' for the y-axis isn't enough for my use-case. I have a graph with two waveforms: one waveform is brightness on the primary y-axis (roughly 1 to 5000), while another waveform is sunrise/sunset on the secondary y-axis (boolean 0/1). With only global logarithmic: true, the sunrise/sunset waveform breaks; this change allows keeping brightness logarithmic while leaving sunrise/sunset linear via entity-level override.

Resolves #862

Current Example of why logarithmic: true globally doesn't work Example with the fix

@ildar170975
Copy link
Collaborator

ildar170975 commented Mar 9, 2026

Thank you! Will check it soon.
Meanwhile, if you have some spare time, test other PRs; start with recently updated ones. Of course, only if you are interested in the proposed functionality, no obligations))

@ildar170975
Copy link
Collaborator

@mxr
Added some observations, please consider.

For me, the whole "graph" functionality (described in a graph.js) is still a complex thing which I am not 100% familiar with.
In this PR there are mostly SIMPLE changes, a global logarithmic option is "augmented" by a a per-entity option.
What probably needs to be at least confirmed - is a building a logarithmic graph itself.
Of course, we may blindly trust the current implementation - but these algorithms should be analysed & improved if needed in future (at least to become "maintainable").

For now, I think this PR achieved it's minimal goal (per-entity option).
@akloeckner - please review when you have a spare time.

@mxr
Copy link
Contributor Author

mxr commented Mar 11, 2026

Thanks for the feedback. I implemented it in mxr@6518e8b (GitHub seems to be lagging so I amended the prior commit)

What probably needs to be at least confirmed - is a building a logarithmic graph itself.

I have an example in the PR description. Let me know if I misunderstood.

@mxr mxr force-pushed the entity-logarithmic-axis branch from 6518e8b to 9dfd832 Compare March 11, 2026 13:36
@ildar170975
Copy link
Collaborator

ildar170975 commented Mar 11, 2026

I totally understood your example, I meant a technical implementation of the Graph class itself. Repeat, the PR looks fine, but since personally me may not know some details of Graph class, I am not sure that the whole logarithmic thing works properly. Let’s merge and then test.

@ildar170975 ildar170975 changed the title fix: add per-entity logarithmic override feat: add per-entity logarithmic override Mar 11, 2026
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.

2 participants