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

WIP: Charts module #143

Closed
wants to merge 11 commits into from
Closed

WIP: Charts module #143

wants to merge 11 commits into from

Conversation

tlwr
Copy link
Contributor

@tlwr tlwr commented May 30, 2017

CyberChef is very useful for slicing and dicing and some analysis, but I often find myself dumping CyberChef output into GNUPlot or a spreadsheet to do some analysis. With a module system in the works I thought charting be a good candidate for an initial module.

Currently I'm using D3 to generate SVGs, this method allows us to just save the generated SVG for embedding elsewhere.

Currently I have implemented:

  • Hexagon density charts

I would love to see in the comments what visualisations or charts would be useful: links to blog posts, pictures, and d3 blocks would be highly appreciated.

Here is the Hexagon density chart (heavily influenced by this block):
image

@sroberts
Copy link

Ok, that's just amazing. That looks super super good. This and some time series style charts like these:

@tlwr
Copy link
Contributor Author

tlwr commented May 30, 2017

I've added outlines and colour customization for hex density plots:

image
Also if anyone knows how to make hexagon plots behave better for disproportional scales please let me know!

--

@sroberts thanks for those suggestions, I've never seen a timeline like that before! The time-series is my next goal.

One constraint I'm applying is SVG only because I think having JS in the output pane would make things very messy and not portable. I would like for a user to be able to copy and paste one of these into a presentation or document. I do think I can figure out how to do these visualizations just with SVG (though but with slightly less interactivity).

This is the native SVG tool-tip (title element) I am currently using:
image

@mattnotmitt
Copy link
Collaborator

mattnotmitt commented May 31, 2017 via email

@tlwr
Copy link
Contributor Author

tlwr commented May 31, 2017

The output is SVG and I plan on ensuring that the charting operations are deterministic (where possible), this will make it easy to write tests, although they probably won't be that elegant.

For non-deterministic charts, presently I have no idea how to effectively test them.

Update: I'm working on allowing dense (rather than sparse) drawing of hexagons:
image
Same data, different radii:
image

@n1474335
Copy link
Member

n1474335 commented Jun 1, 2017

This looks pretty cool and will definitely make sense once the module system is in place. Due to d3's size, I doubt we'll be able to merge it before then, but it's good to see the progress.

There are a couple of operations that make use of charts already: 'Entropy' and 'Frequency distribution'. For these I just drew custom diagrams using the HTML5 <canvas>. You can see how it works here, including how to run JS in the output if you want to go down that path. I think the SVG route is a bit cleaner (and less dangerous), but it might be useful if you have no other options.

Nice work.

@tlwr
Copy link
Contributor Author

tlwr commented Jun 12, 2017

Haven't had a ton of time to work on this but here is a quick update.

Series charts with svg title tooltips:

image
I want to add an option that makes all the Y axes the same.

Heatmap chart:

image

Scatter chart:

image

HTML to Text operation

This is so you can easily export a chart, or other HTML tables
image

@n1474335 thanks for the suggestions, I did look at them before starting this project. I think SVG is more "portable" and as you mentioned safer. I don't think these chart operations should aim to be any more than tools for ad hoc data analysis within CyberChef, or a tool to quickly embed results into a report, rather than fully fledged charting toolkits like Tableau, Plotly, etc.

I'm perfectly happy to wait for the module system to be implemented, however so far the inclusion of d3 and d3-hexbin and all the new operations creates a 3.23MB scripts.js so it may not be necessary to wait.

I need to clean up some of the code and do some refactoring, as well as adding a few more charts:

@n1474335 n1474335 mentioned this pull request Sep 20, 2017
@n1474335
Copy link
Member

These are really great. Any chance of updating them to work with the new operation format?

@tlwr
Copy link
Contributor Author

tlwr commented Aug 31, 2018

over 1y old at this point this PR, i should have another look at these, just busy with work.

the blockers i dealt with at the time (which are not insurmountable) was making it work with themes (if this is a thing we care about).

thanks for jogging my memory (at least PGP operations are in now! 😆 )

@n1474335
Copy link
Member

I wouldn't worry too much about themes. I can mess around with that if the operations work.

@shash7
Copy link

shash7 commented Jan 11, 2019

This would be super useful. Any updates on this pr?

@mattnotmitt
Copy link
Collaborator

mattnotmitt commented Jan 11, 2019 via email

@mattnotmitt mattnotmitt mentioned this pull request Feb 23, 2019
4 tasks
@tlwr
Copy link
Contributor Author

tlwr commented Mar 16, 2019

Closing this in favour of #496 as @artemisbot is taking this on, thanks @artemisbot!

@tlwr tlwr closed this Mar 16, 2019
BRAVO68WEB pushed a commit to BRAVO68WEB/CyberChef that referenced this pull request May 29, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants