Drop #239 (2023-04-12): 🕸️ Webslinger Wednesday
🛠️ Your Own, Private, D3 Workshop; 🛑 Stop Making Terrible Python Plots; 🔎 A TUI IDE For HTTP Requests
Hey true believers!
In yesterday's Drop, I kind of made a big deal out of the fact that javascript and WASM are eating the planet. So, it seemed only fitting to get stuck in that web a bit today.
One of the resources (there are actually two in the section) will help onboard you into — or level up your skills in — D3 and SVG machinations (so you can make killer viz and other data-driven creations).
Another introduces a new way to use Observable from right within the language I love to hate the most: Python.
Finally, we'll flip the perspective and introduce you to a robust HTTP CLI TUI inspection toolkit.
🛠️ Your Own, Private, D3 Workshop
Shirley Wu is one of the most talented designers, coders, and hackers I've seen over this long lifetime of mine. She's bright, talented, creative and also communicates incredibly well. Shirley has a Frontend Masters course on D3 that's well-worth the investment, but you can get started learning or improving your D3 skills with the Observable notebook companion collection she walks you through in the series. It is heavily annotated, making a great educational experience all on its own.
She takes you on a full journey, explaining everything along the way, and even gives you a neat collections of utility functions that you can and will make great use of in your work.
The step-by-step approach in the collection breaks everything up into very digestible chunks; and, if you do run into questions/gotchas, the Observable community is always there to help.
This “SVG and D3 Basics” notebook by NYU's Visualization and Data Analytics Research Center is also handy to have bookmarked to both learn and reference.
🛑 Stop Making Terrible Python Plots
I have a feeling everyone already knows about this, but “no assumptions” and all that.
Tis no secret I don't like a certain language, but I know like everyone else does. However, this new Python interface to Observable Plot is just astounding and remarkable in how well it is implemented, and how easy it is to use.
As Julien Barnier (the creator) self-states: “pyobsplot [enables you] to use Observable Plot to create charts in Jupyter notebooks, VSCode notebooks, Google Colab and Quarto documents. Plots are created from Python code with a syntax as close as possible to the JavaScript one.”
It's the last part that is incredibly impressive. Julien managed to almost perfectly mimic the javascript call syntax. i.e., this is not js:
Plot.plot({
"grid": True,
"color": {"legend": True},
"marks": [
Plot.dot(
penguins,
{"x": "flipper_length_mm",
"y": "body_mass_g", "fill": "species"}
),
Plot.density(
penguins,
{"x": "flipper_length_mm",
"y": "body_mass_g", "stroke": "species"}
)
]
})
Here are some of the core features:
Syntax as close as possible to the JavaScript one (ref: above)
Two renderers available: widget, which generates plots as Jupyter widgets, and jsdom, which generates SVG or HTML outputs
Pandas and polars DataFrame and Series objects are serialized using Arrow IPC format for improved speed and data type conversions
Works offline, no iframe or dependency to Observable runtime
Caching mechanism of data objects if they are used several times in the same plot
Custom JavaScript code can be passed as strings with the js method
Python date and datetime objects are automatically converted to JavaScript Date objects
Works with Jupyter notebooks and Quarto HTML documents. Plots without legends are also supported in PDF and docx outputs with the jsdom renderer.
Since I like being honest with Drop readers, I'm more than happy to provide links to Python resources if it means I never have to see another horrible matplotlib plot ever again.
🔎 A TUI IDE For HTTP Requests
Wuzz is an “interactive CLI tool for HTTP inspection”. It is designed to help security researchers better understand what is happening with their HTTP requests during assessments. It is easy to install and use, and has the potential to be a powerful tool for HTTP(S) inspection. Other HTTP inspection tools include Postman, which is a graphical interface for making and inspecting HTTP requests.
Wuzz's CLI arguments are similar to cURL's arguments, so it can be used to inspect and modify requests copied from a browser's network inspector with the “copy as cURL” feature. However, Wuzz is an interactive command-line tool for HTTP inspection, while cURL is a command-line tool for transferring data with URLs. Wuzz has features such as context-specific search, regular expression filtering, and custom query syntax. Additionally, Wuzz has a more user-friendly interface than cURL, making it easier to use for HTTP inspection.
“But, Postman can do most of what Wuzz does.”
Sure, they're both tools for HTTP inspection, but they do have some differences. Wuzz is an interactive TUI for HTTP inspection, while Postman is a graphical interface for making and inspecting HTTP requests (yes, it does have a CLI, but not nearly as cool as Wuzz's). Postman is generally more focused on automated testing, team collaboration, and API documentation, whereas Wuzz is more of “hacking” tool.
I'd rather work in a TUI any day over browser Developer Tools, and I think the section title does Wuzz a fine bit of justice.
It's 100% worth having in your daily toolbox.
FIN
Catch y'all on Notes! ☮
#wuzz #observable #d3 #svg #wuzz #plot #python #pyobsplot