Skip to content

Instantly share code, notes, and snippets.

@fabiovalse
fabiovalse / README.md
Last active April 21, 2024 13:49
Schema.org hierarchy Sunburst
@fabiovalse
fabiovalse / README.md
Last active February 12, 2024 17:59
HighlightJS & JSON

This gist shows how to use HighlightsJS. A JSON structure is shown in a <code> tag using one CSS highlighting style made available by the library. JSON.stringify() has been used for prettifying JSON data.

@fabiovalse
fabiovalse / README.md
Last active January 31, 2024 07:39
Non-overlapping circles through collision detection

This exercise allows to displace circles in a non-overlapping way. The collision detection introduced in this gist has been used in order to guarantee a certain padding between circles. The slider on the top allows to change the padding distance between circles.

@fabiovalse
fabiovalse / README.md
Last active January 20, 2024 19:56
Regular Polygon Vertices Generator

This script allows to generate the vertices, of a regular polygon, as svg circles. It is possible to specify:

  • the number of polygon sides;
  • the radius of the polygon;
  • the svg width and height.

The vertices coordinates are generated splitting a circumference in N parts, corresponding to the polygon sides. If N=1 then the vertice coordinates correspond to the center of the circumference.

@fabiovalse
fabiovalse / README.md
Last active January 26, 2023 14:28
Dijkstra on node-link diagram

A node-link diagram running a javascript implementation of the Dijkstra algorithm. Every time the visualization is refreshed two nodes are selected as start (in red) and end point (in blue). Then the shortest path is computed and shown on the diagram by highlighting the edges.

@fabiovalse
fabiovalse / README.md
Last active October 1, 2021 19:58
A-Frame DAE isometric view

The camera of A-Frame is set in order to simulate an isometric view.

@fabiovalse
fabiovalse / README.md
Last active July 3, 2021 14:05
Equidistant Points Along an Archimedean Spiral
@fabiovalse
fabiovalse / README.md
Last active June 29, 2020 14:42
Points Along an Archimedean Spiral
@fabiovalse
fabiovalse / README.md
Last active November 8, 2019 07:28
Schema.org ontology tree

This tree represents the hierarchy of the schema.org schema. The 642 types of the core vocabulary are depicted as red nodes while the bib and auto extensions are respectevely represented by the blue and green nodes.

Hovering the label of a type pops up its properties listed in the official jsonld file.

The header on the top allows to filter the extensions of the core vocabulary.

@fabiovalse
fabiovalse / README.md
Last active November 8, 2019 07:27
Solar System Overview

An overview diagram of the solar system. The sun is placed on the left and every planet rotating around it is placed on the right along its own orbit. Some planets, such as Jupiter or Saturn, have in turn moons drawn around them.

The color of the planets indicates the type of celestial body such as terrestrial, gas giant, ice giant, asteroid, plutoid and satellite.

Except the sun, planet dimensions have been computed using the same scale (i.e., power scale with a 0.4 exponent). Also the planet distance from the sun and the moon distance from their primary planet have been calculated using the same scale (i.e., power scale with a 0.33 exponent).

Data have been taken from Wikipedia.