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

Consistent stacked bar colors for generic data #2795

Open
philrz opened this issue Jun 30, 2023 · 0 comments
Open

Consistent stacked bar colors for generic data #2795

philrz opened this issue Jun 30, 2023 · 0 comments

Comments

@philrz
Copy link
Contributor

philrz commented Jun 30, 2023

Repro is with Zui commit 729f9ee. This was first spotted during review of #2785 but we chose not to fit it into that iteration.

Thanks to the Brimcap plugin, the stacked bar chart for a pool based on imported pcap data uses the same consistent colors it did in the past using Zeek _path. However, for non-pcap data (such as the sample.zng from the Zui repo) we see in the attached video how the representation of the same data counts in the bars can change based on the zoom level, e.g., yellow+purple for a pair of types becomes orange+blue after zooming.

Repro.mp4

When discussing this as a team, @mccanne suggested that we could perhaps craft a solution that leverages consistent hashing to automatically pick colors and have them consistently land with the same types. I did some web searches and quickly found that others have struggled with this same problem, e.g., Grafana dealing with it at grafana/grafana#3250. The tl;dr I see is that after several years of noodling on it they did come up with a solution using the string-hash library. Perhaps we can borrow some ideas from their experience.

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

No branches or pull requests

1 participant