From Datalog to SVG
The article addresses challenges in exporting generative algorithm results, introducing a method using Datalog queries and a domain-specific language to create smaller, efficient .grph files that retain graph data.
Read original articleThe article discusses the challenges of exporting generative algorithm results, particularly in the context of vector drawings in SVG format. The author notes that while SVG files are commonly used, they often lose the underlying graph topology, making it difficult to modify the drawing logic later. To address this, the author has developed a method to export graph data using Datalog queries, which allows for a more efficient representation of graph properties and edges. The article details the creation of a graph instance and the use of Datalog to query and export edge properties. Additionally, a domain-specific language (DSL) is introduced for generating SVGs directly from Datalog queries, which retains both the graph data and the drawing logic in a .grph file. This approach results in significantly smaller file sizes compared to SVGs while preserving the necessary information to recreate the drawings. The author emphasizes the utility of using Lisp macros for these tasks, suggesting that this method may be more cumbersome in other programming languages. The article concludes with a note on the experimental nature of the Datalog implementation and hints at future posts that will simplify the DSL.
- The author explores the limitations of SVG files in preserving graph topology.
- A new method for exporting graph data using Datalog queries is introduced.
- A domain-specific language (DSL) is created for generating SVGs from Datalog queries.
- The .grph files are significantly smaller than the corresponding SVG files while retaining essential information.
- The article highlights the advantages of using Lisp macros for generative drawing tasks.
Related
SVG: The Good, the Bad, and the Ugly (2021)
SVG, scalable vector graphics, is a versatile format for web design, supporting various graphic elements like paths, shapes, text, and animations. Despite its power, its complexity and extensive specifications can be challenging for users.
GPU-Friendly Stroke Expansion
The paper introduces a GPU-friendly technique for stroke expansion in vector graphics, optimizing GPU rendering with parallel algorithms and minimal preprocessing. It addresses efficient rendering of stroked paths, enhancing performance in vector graphics.
2D DLA Experiments
The article explores 2D diffusion-limited aggregation (DLA) experiments in JavaScript, covering basic DLA, directional bias, sizes, shapes, SVG input, interactivity, and flowfields. It emphasizes interactive simulations to study DLA phenomena.
RAG is more than just vectors
The article explores Retrieval-Augmented Generation (RAG) as more than a vector store lookup, enhancing Large Language Models (LLMs) by fetching data from diverse sources, expanding capabilities and performance.
SVG Triangle of Compromise
The article explores SVG (Scalable Vector Graphics) on the web, highlighting its stylability, cacheability, and dimensionality, while discussing advantages and challenges in web design and performance considerations.
This was a React front end, and can't speak highly enough of how well it works with relatively simple dynamic svg rendering.
Related
SVG: The Good, the Bad, and the Ugly (2021)
SVG, scalable vector graphics, is a versatile format for web design, supporting various graphic elements like paths, shapes, text, and animations. Despite its power, its complexity and extensive specifications can be challenging for users.
GPU-Friendly Stroke Expansion
The paper introduces a GPU-friendly technique for stroke expansion in vector graphics, optimizing GPU rendering with parallel algorithms and minimal preprocessing. It addresses efficient rendering of stroked paths, enhancing performance in vector graphics.
2D DLA Experiments
The article explores 2D diffusion-limited aggregation (DLA) experiments in JavaScript, covering basic DLA, directional bias, sizes, shapes, SVG input, interactivity, and flowfields. It emphasizes interactive simulations to study DLA phenomena.
RAG is more than just vectors
The article explores Retrieval-Augmented Generation (RAG) as more than a vector store lookup, enhancing Large Language Models (LLMs) by fetching data from diverse sources, expanding capabilities and performance.
SVG Triangle of Compromise
The article explores SVG (Scalable Vector Graphics) on the web, highlighting its stylability, cacheability, and dimensionality, while discussing advantages and challenges in web design and performance considerations.