Skip to content

Instantly share code, notes, and snippets.

View nbremer's full-sized avatar

Nadieh Bremer nbremer

View GitHub Profile
@nbremer
nbremer / .block
Last active January 15, 2023 14:27
Data based orientations in SVG Gradients - Final example - Avenger Movie Collaborations
height: 1000
license: mit
@nbremer
nbremer / README.md
Last active December 12, 2022 10:48
Circle Packing at its most Basic - Canvas & D3.js

This is the first step of my first attempt to learn canvas. I want to improve a piece a made a few weeks ago about the division of occupations. The d3.js version has so many DOM elements due to all the small bar charts that it is very slow. Therefore, I hope that a canvas version might improve things.

In this block I create a static circle pack layout that still uses a lot of D3 code, but eventually it is the canvas that draws it to the screen

I wrote a more extensive tutorial around what I learned while doing this project in my blog Learnings from a D3.js addict on starting with Canvas in which this can be seen as step 1. See the next version that has less D3 but less overall code as well

If you want to see the final result, with everything up and running in canvas look [here](http://www.visualcinnamon.com/occupation

@nbremer
nbremer / README.md
Last active November 30, 2022 15:24
Zoomable Circle Packing with Canvas & D3.js - I

This is the third step of my first attempt to learn canvas. I want to improve a piece a made a few weeks ago about the division of occupations. The D3.js version has so many DOM elements due to all the small bar charts that it is very slow. Therefore, I hope that a canvas version might improve things

To not stray too far from D3.js I used the excellent tutorials on canvas and d3 from Irene Ros & Yannick Assogba which you can find here and here. I managed to get the circle packing working. However, when you zoom it is very jittery.

I wrote a more extensive tutorial around what I learned while doing this project in my blog Learnings from a D3.js addict on starting with Canvas in which this can be seen as step 3. See the previous, [non-zoomable version here](http://bl.ocks.org/

@nbremer
nbremer / README.md
Last active October 3, 2022 03:25
Linear SVG Gradient - A hexagonal SOM heatmap with color legend

This is an example from my blog on Creating a smooth color legend with an SVG gradient. The color legend below is just a simple rectangle filled with an SVG gradient. But in for this particular data it works well, because you are mostly interested in trends, to get a general sense of then numbers. Therefore, it is not imperative to be able to read the exact value that each color represents. And in those cases, when you work with a quantitative color scale, I prefer to use smooth color legends.

The map you see is the visual output from a Machine Learning Technique to cluster data called Self-Organizing Maps. If you want to learn more about this fabolous technique, see my SOM blog series

You can other SVG legend gradient examples here:

@nbremer
nbremer / .block
Last active September 27, 2022 11:16
Brushable Horizontal Bar Chart - V
height: 540
@nbremer
nbremer / .block
Last active November 8, 2021 14:22
Stretched Chord Diagram - From educations to occupations
height: 780
license: bsd-2-clause
@nbremer
nbremer / .block
Last active May 8, 2021 05:08
Simple click to change location scatterplot
license: mit
@nbremer
nbremer / .block
Last active March 28, 2021 02:45
Phyllotaxis layout in SVG
license: gpl-3.0
height: 960
@nbremer
nbremer / .block
Last active June 9, 2020 05:08
Gooey effect - Data visualization showcase
height: 680
@nbremer
nbremer / README.md
Last active February 10, 2020 11:01
Color blending - Infinity showcase

This is one of the color blending examples of my blog on Beautiful color blending effects with SVGs & D3

In this small showcase you can see the effect of using a mix-blend-mode on your SVG elements. Every 3 seconds it switches to a different set of colors or switches from "screen" to "multiply" mode and there are 7 different sets before it begins anew. In one ofthe 7 sets, it sets no blend mode and you can see with your own eyes that that version definitely has less magic :)

This example is heavily based on the wonderful particle demo of Sketch.js. I fell in love with it when I first saw it and really wanted to use it in my OpenVis presentation. Because I already thought it was perfect I only made the changes to make it run in an infinity symbol (for infinity) instead of attaching it to a mouse and to loop through several sets of colors and both the screen and multiply blend modes. Also, si