Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed Speed based Color Mapping from Theme Color to TurboColorRamp #1258

Merged
merged 9 commits into from
Oct 1, 2024

Conversation

Kalabint
Copy link
Contributor

Thanks to the work of @jcardus the Replay and Report Lines are now colored based on the current speed.

What i noticed is, that the Information density with the MUI Color Scheme is not so great, because the second half is mapping from Orange to Red, which are very similar colors.

image

This is the reason, i'm proposing the Turbo Color Ramp as an alternative.

image

Using the Turbo Color Ramp it would look something like this in Traccar:

image

A Discussion point is, if the Scale should be dynamic, or based on a customizable Attribute (0-200km/h for example).
Benefit of the Attribute would be, that one can see at a glance, how fast a Vehicle is moving, without checking a Scale first.

@tananaev
Copy link
Member

What I don't like is the hardcoded color palette. Is there a way to generate it?

@tananaev
Copy link
Member

There must be an easier way to get a similar palette. This implementation seems like an overkill.

@Kalabint
Copy link
Contributor Author

Does the license text need to be in the file or is it ok to leave it out?

@tananaev
Copy link
Member

You can probably leave it out. The new code looks much better, but make sure you run lint on it.

src/common/util/colors.js Outdated Show resolved Hide resolved
@Kalabint
Copy link
Contributor Author

Based on this and my own needs, i added a custom attribute to set the max expected device speed.

Is this addition ok?

@tananaev
Copy link
Member

tananaev commented Oct 1, 2024

Sorry, but it's not ok to add to this PR. Let's keep this as it was and send a separate PR if you want something else as well.

@Kalabint
Copy link
Contributor Author

Kalabint commented Oct 1, 2024

Sorry, but it's not ok to add to this PR. Let's keep this as it was and send a separate PR if you want something else as well.

Taking things step by step is the right thing to do.

Currently working on a Scale based on this idea, will create a new PR, when it becomes relevant, if at all. Still have some work to do there.

image

@tananaev tananaev merged commit 10b8a91 into traccar:master Oct 1, 2024
1 check passed
@tananaev
Copy link
Member

tananaev commented Oct 1, 2024

Merged, thank you.

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