Skip to main content
100%

highlight.js

✓ Published0🌍 Public
EEfratVil
Last edited Jan 15, 2018
Created on Nov 15, 2017

This example demonstrates how to display a JavaScript object as formatted, syntax-highlighted code on a web page. It uses the highlight.js library to apply color-coded styling to a JSON string representation of a small dataset, while D3 v4 populates the `<code>` element with the data. The code first defines an array of objects with name and size properties, then uses `d3.select` and `json.stringify` to insert the formatted data into the page. The visible result is a clean, readable code block, though no interactive visualization is present.

AI-generated description

Using highlight.js

Similar vizzes