Tell us what works and what could be better. We read every submission.
@adamscott·28 public vizzes
This example demonstrates how to scale a Godot application’s content for HiDPI displays using the engine’s built-in scaling system. It shows a single line of GDScript that sets the root viewport’s `content_scale_factor` based on the display’s reported scale, retrieved via `DisplayServer.screen_get_scale()`. The code assigns this factor in the `_ready()` function of a `main.gd` script, ensuring the interface adapts to high-resolution screens without manual pixel calculations. The example relies on Godot’s `SceneTree` root and `DisplayServer` API, with no external libraries or data sources.
This example presents a Python configuration script for the Godot game engine’s SCons build system, defining default values and caching behaviors for older versions. It shows how parameters like `platform`, `target`, and `dev_build` are set conditionally via `set_param` and `get_param`, with logic for macOS, Linux, and Windows detection. The code uses SCons’ `ARGUMENTS` and `TRUE_STRINGS` APIs, plus subprocess calls to check for tools like `brew`, `mold`, and `git` branch status. It also demonstrates environment detection through `platform_module` and optional integration with `mise.toml`.
This example demonstrates a safe-flag test for WebAssembly threads, showing atomic boolean operations across thread creation and joins. The program stores and loads a boolean with `memory_order_release` and `memory_order_acquire` semantics, printing its value from both the main thread and a spawned thread. It builds with SCons using the Emscripten toolchain, enabling pthreads via `-sUSE_PTHREADS=1` and shared memory, while the C++17 code relies on `std::atomic_bool` and `std::thread`. The visualization compiles to `index.html`, `index.js`, and `index.wasm` for browser execution.
This example demonstrates a command-line utility that processes source files with Emscripten macro interpolation, reading an input file and a JSON settings file, then producing a preprocessed output file. It uses Node.js built-in modules like `node:fs`, `node:vm`, and `node:util` for file operations, argument parsing, and context execution. The script imports Emscripten’s `processMacros` and `preprocess` functions to handle macro expansion and outputs the result to the console. The command supports options like `--help`, `--version`, `--verbose`, and `--emscripten-path` to customize behavior.
This example visualizes the permutations of C-like preprocessor directives by generating a separate file for each possible conditional branch combination. It parses source lines into a fragment tree of `Either` nodes representing `if`/`else` branches, then recursively renders every permutation into distinct files. The visualization relies on Python’s `re` module for token matching, and file I/O via `Path` and `tempfile`. The rendering process uses custom `Fragment` and `Either` classes to track conditional logic, demonstrating how combinatorial preprocessor states can be systematically enumerated and output.
This example parses Godot Engine’s XML class reference across multiple versions into a SQLite database, tracking how classes, methods, signals, and other API members change over time. It uses `xml.etree.ElementTree` for XML parsing, `semver` for version handling, and `subprocess` to check out specific Godot repository tags. The parser builds normalized tables with foreign keys linking each API item to its class and version, enabling cross-version comparison. The accompanying how-to file documents the init and parse commands for generating the local `godot_version_doc.db`.
This keyboard layout visualization maps the Canadian Multilingual Standard (French Canadian Apple) key codes to their corresponding character outputs, including base, shifted, control, alt, and alt-shift states. The data source is a FreeBSD keymap definition file that specifies character mappings for each physical scan code. The visualization displays the layout as a standard keyboard grid, with each key showing its character in multiple modifier states, using colors or annotations to distinguish layers such as Control, Option (Alt), and Option-Shift combinations. Special characters like ¡, ≈, œ, and Œ are highlighted in their respective positions, making the otherwise complex hexadecimal keycode table immediately comprehensible. The layout preserves the familiar QWERTY arrangement while adding French Canadian accents, with clear visual separation of each modifier layer.
This visualization tracks how long it takes a web page to load each of its resources, plotting connection phases like DNS lookup, SSL negotiation, and response time along a horizontal timeline. A brushable time-series chart shows aggregated load durations, while a linked table sorts individual requests by phase. The example uses `d3.brushX` for interactive selection and custom `d3.axisBottom` scales, with data parsed from a HAR file containing simulated network timings.
This example shows a login state machine built with XState, modeled as an explicit statechart with idle, loading, success, and failure states. It demonstrates asynchronous data fetching by invoking a `fetchJwt` function that retrieves a JSON Web Token from a remote URL. The machine uses the `invoke` property with `onDone` and `onError` transitions, assigning the returned user data or an error to the context via the `assign` action. The visualization, generated by XState Viz, renders the statechart diagram from the `machine.js` source file, highlighting how state transitions and async side effects are encoded in the machine definition.
This example shows a parallel state machine for user management, with three concurrent sub-machines tracking login status, user data loading, and client data loading. XState Viz renders the machine definition into an interactive diagram, displaying each sub-machine’s states and transitions. The code uses the `Machine` and `interpret` APIs from XState to define a `userManagement` machine with parallel states, where events like `LOGIN_SUCCESS` and `LOGOUT` trigger coordinated transitions across all three regions. The visualization updates live to reflect the current state configuration.
This example shows a multi-step form wizard for a free trial signup, where users navigate through fields like name, email, and password before reaching a confirmation screen. The state machine, defined with XState’s `Machine` and `interpret`, tracks the current form and skips already-filled fields using guards like `hasNext` and `hasBack`. Actions such as `assign` update the `currentForm` based on helper functions `getNextForm` and `getBackForm`, while the initial context pre-populates email and employee data. The visualization, rendered by XState Viz, displays transitions between `idle`, `form`, and `confirm` states.
This example shows a state machine for a free-trial signup flow, progressing from an idle state through name entry to an email state. The machine starts in `idle`, waits for a `READY` event, then moves to `name`, where an entry action logs the context and event before automatically raising a `NEXT` event to transition to `email`. It uses XState’s `Machine` and `raise` API to define states, transitions, and context with a `retries` counter. The code includes a custom `nameEntry` action that triggers the next step programmatically.
This parallel state machine, generated by XState Viz, models a multi-step campaign assistant flow with conditional transitions and temporary or finalized contexts. The visualization shows nested states like `flow`, `confirm`, and `finalizing`, using guards (`isTemporary`, `hasNoInfo`) and actions (`assign`, `raise`) from the XState library. It displays routing metadata for each step and handles events such as `START`, `NEXT`, `BACK`, and `INFO_CHANGED` to navigate between states.
This visualization shows a state machine for a multi-step signup and onboarding flow, navigating through states like signup, sniffer, validate, industry, objective, and browse. It uses XState’s `Machine` API to define hierarchical states, transitions, guards (e.g., `hasNotSniffed`, `isNotValidated`), and actions like `goNext` and `goBack` that update the context’s direction. The rendered diagram, generated by XState Viz, illustrates conditional branching on events like `NEXT` and `BACK`, with exit actions assigning `hasSniffed: true` after leaving the sniffer state.
This example shows a fontconfig rule that makes Konsole display Noto Color Emoji glyphs whenever the Fira Code font is selected, enabling color emoji support in the terminal. It works by matching the family name “Fira Code” and prepending “Noto Color Emoji” with a strong binding, overriding the font fallback order. The configuration is installed to `~/.config/fontconfig/conf.d/99-fira-code-color-emoji.conf` and activated with `fc-cache`. The XML uses fontconfig’s `<match>`, `<test>`, and `<edit>` elements to modify the font family list at runtime.
This example displays a list of article titles from a Montréal journal, rendered as static SVG text elements. The visualization initially shows a placeholder message before fetching JSON data via `d3.json`, then binds the retrieved titles to newly entered text nodes using `d3.selectAll` and `data().enter()`. All text is positioned at fixed coordinates with a uniform font size, and the SVG canvas is created through `d3.select("body").append("svg")`. The code relies on D3 v4 APIs, including the core selection and data-join methods, with no interactive or animated behavior.
This example demonstrates how to deserialize JSON responses from the CanLII legal database into strongly typed Rust structs using the `serde` and `serde_json` libraries, with `serde_derive` providing automatic trait implementations. It defines nested structures for search results, cases, legislation, and case identifiers, using attributes like `#[serde(rename)]` and `#[serde(skip_serializing_if)]` to handle API naming conventions and optional fields. The `main` function parses sample JSON payloads—including a large search response with over 1.6 million results—and prints selected fields to verify the deserialization works correctly.
This example demonstrates Rust structs that model a search response with optional legislation and case results. The code uses the `serde` and `serde_derive` crates to derive `Serialize` and `Deserialize` traits, enabling JSON parsing through `serde_json::Value`. It defines nested types like `SearchResponse`, `Result`, `LegislationResult`, and `CaseResult`, with `#[serde(skip_serializing_if)]` and `#[serde(rename)]` attributes to control serialization behavior. The `main` function currently prints a placeholder message, indicating the data structures are ready for use but not yet processed.
The visualization shows the step-by-step output of a Travis-CI build log for compiling a non-static Python 3.5.2 from source, rendered as a three-dimensional WebGL scene. It maps the chronological log lines into a spatial path where each check or configuration step appears as a distinct visual node, with color or height encoding the progress and outcome of the build process. The rendering uses Three.js to create the 3D perspective, while the underlying data comes from the raw log text captured from the build’s `configure` and compile commands. The scene highlights the sequence of system checks, compiler tests, and header verifications that occur during the installation.
This example presents the startup and resource-loading phase of a Qt-based desktop application called Génial. It initializes a `QApplication` instance, enables high-DPI scaling, and loads embedded Qt translation files from `.qrc` resources using `QTranslator` with the system locale. The code imports resource modules (`icons_rc`, `locale_rc`, `plugins_rc`) and then launches the main controller, which starts the application event loop via `app.exec()`. The visualization focuses on the application’s initialization logic rather than graphical data rendering.
This visualization shows the progress and output of a Qt build process through a log file viewer. It presents the contents of `configure.log`, revealing the sequence of configuration checks, compiler tests, and build decisions for Qt 5.7.0. The display uses a plain text rendering approach, likely leveraging PyQt's text widgets to present the log data. The viewer highlights key status messages and errors, making the build process easier to scan. The implementation relies on PyQt5 APIs for the graphical interface, with the log file read directly from the source repository path.
This visualization maps the geographic distribution of Qt build configurations by rendering a world map with colored regions. It uses `d3.geoPath` to project country boundaries and `d3.forceSimulation` to position data points, with color intensity reflecting the number of configuration entries per location. The underlying data comes from a Qt 5.7.0 source build log, parsed into a JSON structure for geographic aggregation. The map employs a sequential color scale to highlight high-activity areas while preserving spatial context.
This example compares build logs from Linux, macOS, and Windows by visualizing their file sizes and completion states. It uses d3.forceSimulation to position log files as nodes in a force-directed graph, with node size proportional to file size and color indicating build success or failure. The rendering relies on SVG paths generated by d3.geoPath, while the data comes from the three platform-specific log files (configure, make, and make_install). The visualization highlights platform differences in build output without displaying raw log contents.
This visualization maps the dependency relationships among Arch Linux packages by filtering `makedepends` entries from `cower` output. It shows a force-directed network where each node represents a package and links connect packages sharing build-time dependencies. The graph uses `d3.forceSimulation` to position nodes based on connection strength, with SVG rendering for the final layout. Data flows through shell pipelines that extract package names from `cower -i pico`, trimming output with `cut` and filtering for specific patterns. The display highlights clusters of tightly coupled packages while revealing isolated nodes, making the structure of build dependencies immediately visible.
The visualization demonstrates a shell script that repairs a security flaw in the Pico-8 binary by removing a hardcoded RPATH pointing to `/usr/local/lib`, which is inappropriate for Arch Linux. It shows the `fix-rpath.sh` file using the `chrpath` command with the `--delete` flag to strip the insecure path. The example highlights a command-line data-processing task rather than graphical rendering, relying on the system's `chrpath` utility to inspect and modify ELF binary metadata. No JavaScript libraries or charting APIs are involved; the focus is on the script's logic and the specific tool invocation.
A build configuration script for Qt 5.7 on OSX demonstrates how to strip the framework down to only essential tools by disabling numerous modules and features. The `configure.sh` file passes flags like `-skip qt3d`, `-no-feature-webengine`, and `-nomake examples` to exclude widgets, networking, image formats, and other components. The process relies on Qt's `configure` tool, explicitly skipping modules such as `qtdeclarative`, `qtmultimedia`, and `qtwebengine`, while disabling features like `properties`, `draganddrop`, and `textedit`. This results in a minimal Qt build focused solely on core tooling, as seen in the verbose flag list.
This example demonstrates a file-splitting utility that pauses after creating each chunk, waiting for the split file to be manually deleted before proceeding to the next one. The script reads data from standard input, writes it to sequentially named files (e.g., backup/filename.aa, .ab, …), and generates a SHA256 checksum for each part. It uses Python’s `sys.stdin.buffer`, `subprocess.getoutput` for hashing, and `os.path.isfile` to monitor file deletion. The suffix logic implements a base-26 letter system with `math.floor` for indexing. The process repeats until input is exhausted.
This example shows how the Rust programming language handles tuples, structs, and custom formatting through a series of exercises from the Rust by Example tutorial. It demonstrates tuple indexing, destructuring, and reversal, plus a Matrix tuple struct with a custom `fmt::Display` implementation that prints it as a two-line grid. It also defines Point and Rectangle structs, computes rectangle area via destructuring, and creates a square from a point and side length. The code uses Rust’s standard `std::fmt` module and the `#[derive(Debug)]` attribute for debug output.