• Stars
    star
    108
  • Rank 321,259 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A d3 visualization widget to help summarizing, exploring and navigating large network visualizations

Star

Moma Explorer Navio:
A visualization widget to understand and explore your data

Use it to summarize, explore and navigate your multivariate data using three simple interactions:

Sort Filter a Range Filter By Value
Click on a header to sort
Navio sort on les miserables network
Drag to select a range
Moma Explorer
Click on a value to select all instances
Navio select a value with the vispubdata

Try it!

You can test Navio right now with your own CSV or JSON data (less than 200MB), using:

Obervable Notebook Shipyard Jupyter Notebook
Navio-load Observable Shipyard loading data Navio Jupyter Notebooks

Other demos:

Comparing

Why using something else for summarizing your data?. Here is how Navio compares with other alternatives:

Navio vs Parallel Coordinates

You can use this Notebook to compare Navio with Parallel Coordinates, using your own data. Please be aware that the Vegalite implementation of Parallel Coordinates will break with a few thousand rows (on the image below it broke with 500 rows and 86 attributes of the fifa19 Kaggle Dataset)

Navio versus Parallel Coordinates

Navio vs Scatterplot Matrix

Use this Notebook to compare Navio with a Scatterplot Matrix, using your own data. Please be aware that the Vegalite implementation of the Scatterplot Matrix only support quantitative attributes and will also break with a dozen attributes and a few hundred rows), therefore the image below only displayed 8 attributes (out of the 28) on the scatterplot matrix.

Navio versus Scatterplot Matrix

Install

npm install navio

Or use it from unpkg

  <script type="text/javascript" src="https://d3js.org/d3.v4.min.js"></script>
  
  <script src="https://unpkg.com/[email protected]/dist/umd/popper.min.js"></script>
  <script type="text/javascript" src="https://unpkg.com/navio/dist/navio.min.js"></script>

Requires ^[email protected], ^[email protected]. If you want to use d3@4 use [email protected]

Usage

TLDR

<!DOCTYPE html>
<body>
  <!-- Placeholder for the widget -->
  <div id="navio"></div>

  <!-- NAVIO Step 0: Load the libraries -->
  <script type="text/javascript" src="https://d3js.org/d3.v6.min.js"></script>
  <script src="https://unpkg.com/[email protected]/dist/umd/popper.min.js"></script>
  <script type="text/javascript" src="https://unpkg.com/navio/dist/navio.min.js"></script>

<script>
  // NAVIO  Step 1.  Create a Navio passing a d3 selection to place it and an optional height
  var nv = navio(d3.select("#navio"), 600);

  d3.csv(YOUR_DATA).then(data) => {
    // NAVIO Step 2. Load your data!
    nv.data(data);

    // NAVIO Step 3. Detect your attributes (or load them manually)
    nv.addAllAttribs();

    // Optional, setup a selection callback
    nv.updateCallback( selected => console.log("selected in Navio: ", selected.length));
  });
</script>
</body>
</html>

Step by step

  1. HTML. Start with this template
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Basic Usage</title>
</head>
<body>

  // Your Navio widget goes here
  <div id="Navio"></div>

</body>
</html>
  1. Import Navio. Create and import a new JavaScript file below the scripts (d3 and Navio) or right in the html like in the example below.
<script src="https://d3js.org/d3.v6.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/navio/dist/navio.min.js"></script>
<script type="text/javascript">
  //   YOUR_JS_CODE_HERE
</script>
  1. Create a Navio Instance
var nv = navio(d3.select("#Navio"), 600); //height 600
  1. [Optional] Configure navio to your liking
// Default parameters
nv.x0 = 0;  //Where to start drawing navio in x
nv.y0 = 100; //Where to start drawing navio in y, useful if your attrib names are too long
nv.maxNumDistictForCategorical = 10; // addAllAttribs uses this for deciding if an attribute is categorical (has less than nv.maxNumDistictForCategorical categories) or ordered
nv.maxNumDistictForOrdered = 90; // addAllAttribs uses this for deciding if an attribute is ordered (has less than nv.maxNumDistictForCategorical categories) or text. Use nv.maxNumDistictForOrdered = Infinity for never choosing Text

nv.howManyItemsShouldSearchForNotNull = 100; // How many rows should addAllAttribs search to decide guess an attribute type
nv.margin = 10; // Margin around navio

nv.levelsSeparation = 40; // Separation between the levels
nv.divisionsColor = "white"; // Border color for the divisions
nv.levelConnectionsColor = "rgba(205, 220, 163, 0.5)"; // Color for the conections between levels
nv.divisionsThreshold = 4; // What's the minimum row height needed to draw divisions
nv.fmtCounts = d3.format(",.0d"); // Format used to display the counts on the bottom
nv.legendFont = "14px sans-serif"; // The font for the header
nv.nestedFilters = true; // Should navio use nested levels?

nv.showAttribTitles = true; // Show headers?
nv.attribWidth = 15; // Width of the columns
nv.attribRotation = -45; // Headers rotation
nv.attribFontSize = 13; // Headers font size
nv.attribFontSizeSelected = 32; // Headers font size when mouse over

nv.filterFontSize = 10; // Font size of the filters explanations on the bottom

nv.tooltipFontSize = 12; // Font size for the tooltip
nv.tooltipBgColor = "#b2ddf1"; // Font color for tooltip background
nv.tooltipMargin = 50; // How much to separate the tooltip from the cursor
nv.tooltipArrowSize = 10; // How big is the arrow on the tooltip

nv.digitsForText = 2; // How many digits to use for text attributes

nv.id("attribName"); // Shows this id on the tooltip, should be unique

nv.addAllAttribsRecursionLevel = Infinity; // How many levels depth do we keep on adding nested attributes
nv.addAllAttribsIncludeObjects = false; // Should addAllAttribs include objects
nv.addAllAttribsIncludeArrays = false; // Should addAllAttribs include arrays

// Default colors for values
nv.nullColor = "#ffedfd"; // Color for null values
nv.defaultColorInterpolator = d3.interpolateBlues;
nv.defaultColorInterpolatorDate = d3.interpolatePurples;
nv.defaultColorInterpolatorDiverging = d3.interpolateBrBG;
nv.defaultColorInterpolatorOrdered = d3.interpolateOranges;
nv.defaultColorInterpolatorText = d3.interpolateGreys;
nv.defaultColorRangeBoolean = ["#a1d76a", "#e9a3c9", "white"]; //true false null
nv.defaultColorRangeSelected = ["white", "#b5cf6b"];
nv.defaultColorCategorical = d3.schemeCategory10;

// // Discouraged: If you want to break perceptual rules to have many more categories use
// // the following "Pi帽ata mode 馃帀"
// nv.defaultColorCategorical = d3.schemeCategory10
//   .concat(d3.schemeAccent)
//   .concat(d3.schemePastel1)
//   .concat(d3.schemeSet2)
//   .concat(d3.schemeSet3);
// nv.maxNumDistictForCategorical = nv.defaultColorCategorical.length;
  1. [Optional] Add your attributes manually. Navio supports six types of attributes: categorical, sequential (numerical), diverging (numerical with negative values), text, date and boolean. You can either add them manually or use nv.addAllAttribs() to auto detect them (must be called after seting the data with nv.data(your_data))
nv.addCategoricalAttrib("attribName", [customScale]);
nv.addSequentialAttrib("attribName", [customScale]);
nv.addDivergingAttrib("attribName", [customScale]);
nv.addTextAttrib("attribName", [customScale]); // Colors by the first nv.digitsForText
nv.addOrderedAttrib("attribName", [customScale]); // Sorts and then colors by rank
nv.addDateAttrib("attribName", [customScale]);
nv.addBooleanAttrib("attribName", [customScale]);

If you ommit the [customScale] parameter it will use the defaults. You can also create your own custom made parameters using nv.addAttrib("attribName", customScale). For example, if you already have a scale for setting the colors of a cluster property on your visualization, you can tell navio to use the same matching colors. Make sure to set the domain and range of the scale, as navio will not try to do it with this function.

var color = d3.scaleOrdinal(d3.schemeSet3)
  .domain["cluster1", "cluster2", "cluster3"];

nv.addAttrib("cluster", color);
  1. Set the data

After loading your data pass it to navio. This will trigger the drawing operation. You can force redrawing using nv.update();

nv.data(myData);

If your data is a network, or you have some links in the same format of a d3.forceSimulation you can also add them to navio using nv.links([links]). This won't trigger a redraw, so make sure to call it before setting your data

nv.links(myLinks);
nv.data(myData);
  1. Detect Attributes. navio also includes a function that detects the attributes automatically, which is slow, redraws the whole thing, and my be buggy. Use it at your own risk. But make sure to call it after setting your data
nv.data(myData);
nv.addAllAttribs();
  1. Set a callback. A function that navio will call when the user filters/sort the data
nv.updateCallback( data => console.log("The filtered data is ", data));

Other methods

# nv.update() <>

Use it to force a redraw of navio after changing the underlying data without losing the filters. Useful in case you modify the data with some other action in your code, e.g. you recomputed clusters in a network chart.

# nv.hardUpdate([opts]) <>

Slower update that recomputes brushes and checks for parameters. Use it if you change any parameters or added new attributes after calling .data. opts can be an object that contains any of the following attributes:

  • shouldDrawBrushes (defaults true)
  • shouldUpdateColorDomains (defaults true)
  • recomputeBrushes (defaults true)
  • levelsToUpdate (defaults all levels, should be an array of indices)

# nv.getColorScales(attr ) <>

Returns the color scale for a certain attribute, make sure to pass an attribute that has been already added

# nv.getAttribs( ) <>

Returns the ordered list of attributes added to navio

License

Navio.js is licensed under the MIT license. (http://opensource.org/licenses/MIT)

<script async defer src="https://buttons.github.io/buttons.js"></script>

More Repositories

1

forceInABox

d3 force plugin that implements the GroupInABox algorithm that distributes nodes using a treemap to identify better clusters
JavaScript
78
star
2

MIDS_W209_Information_Visualization_Slides

Slides for the W209 Information Visualization course of the Masters in Data Science at UC Berkeley
JavaScript
59
star
3

netClusteringJs

A network clustering library for javascript
JavaScript
34
star
4

d3BrushAndLinkingExample

A step by step tutorial on how to do brushing and linking on d3
JavaScript
33
star
5

revealVizScrollyteling

Reveal.js plugin for scrollyteling visualization
JavaScript
28
star
6

d3V4ForceTutorial

A step by step tutorial on how to use the d3 v4 forceSimulation system, to create network visualizations using canvas.
HTML
21
star
7

vastChallenge2017_example

JavaScript
21
star
8

US_Elections_Results

Jupyter Notebook
11
star
9

d3-force-boundary

A D3 Force to avoid nodes from overflowing on a network visualization
JavaScript
9
star
10

visPubNetwork

Citation Network of the IEEE Vis papers
JavaScript
9
star
11

resultadosPrimeraVuelta2018

JavaScript
8
star
12

flask_d3_example

An example combining Flask and d3 to load an US map
JavaScript
7
star
13

d3ReusableChartExample

JavaScript
6
star
14

eleccionesColombia2019

Un esfuerzo por abrir los datos de las elecciones Colombianas regionales de 2019
6
star
15

navio_jupyter

A Jupyter widget for navio
Jupyter Notebook
5
star
16

meteorMultiplayerBoard

An example of a multiplayer board "game" using Meteor (Just for educational purposes)
JavaScript
5
star
17

twitterFollowersCandidatosColombia

Python
4
star
18

pyragua

A simple python editor
Python
4
star
19

consultaAnticorrupcion2018

Datos abiertos en formato JSON con los resultados de la Consulta Anticorrupci贸n Colombia 2018
4
star
20

ColombiaVisualizationReact

JavaScript
4
star
21

momaExplorer

A simple app to explore the MOMA open collection
JavaScript
4
star
22

eliminatoriaConmebolRusia2018

Una visualizaci贸n de los resultados de la eliminatoria Conmebol al mundial Rusia 2018
JavaScript
3
star
23

resultadosPlebiscito

JavaScript
3
star
24

treeversity

Information visualization tool for comparing two trees using numeric values, and created and removed nodes
3
star
25

visual-analytics-course

My slides for my visual analytics course
JavaScript
3
star
26

used-cars-Colombia

just some hacking on the prices of used cars in Colombia
Python
3
star
27

shipyard

A visualization tool to summarize, explore and navigate your data using http://navio.dev
JavaScript
3
star
28

node-express-passport-react-oauth-slack

A demo on how to implement slack Ouath using node, express, passport and react
JavaScript
2
star
29

nodeExpressSqliteEJS_Bikeshare

Example Node + Express + Sqlite3 + EJS + Bootstrap app
JavaScript
2
star
30

untanglingTheHairball

The slides for my OpenVis 2017 talk
JavaScript
2
star
31

randomGrading

A simple app for asking random questions to your students
JavaScript
2
star
32

networkVisualizationLessons

JavaScript
2
star
33

visualAnalytics_24hours

A 24 hours long Visual Analytics seminar
JavaScript
2
star
34

resultadosSegundaVuelta2018

Una visualizaci贸n de los resultados de las elecciones Colombianas para la segunda vuelta
JavaScript
2
star
35

Observable-Local-Mongo-Node

A basic example on how to connect to a local Mongo instance from Observable running a basic node + express server
JavaScript
2
star
36

twitterStreamerMeteor

Meteor + Twitter Streamer
JavaScript
2
star
37

presupuestoColombia

Presupuesto General de la Naci贸n de Colombia: un intento de abrir los datos en formato csv
2
star
38

d3-react-bar-chart-hierarchy

D3 Bar chart hierarchy with react
JavaScript
2
star
39

nodeExpressSqliteEJS_2

A simple demo application on how to combine node + express + sqlite + EJS
EJS
2
star
40

nodeExpressMongoES6_promptStorer

A basic demo application of a prompt storer using Node Express Mongo ES6 modules and client side rendering with AJAX. Made for my webdev class
JavaScript
2
star
41

dummy-prompt-storer-oop

An example built in PDP class of a Prompt Manager using React classes
JavaScript
1
star
42

webDevelopment_spring2017

Lectures of my spring 2017 web development class at los Andes University
JavaScript
1
star
43

twitterDump

A small set of scripts for exploring tweets
Python
1
star
44

meteor-simple-chat

A very simple chat app we coded during my Web Dev Class
JavaScript
1
star
45

node_express_react

Sample application using express generator and create react app
JavaScript
1
star
46

prompt-storer-vite

JavaScript
1
star
47

d3-react

A very basic example demonstrating two ways to connect D3 and React
JavaScript
1
star
48

frecuencias_transmilenio

Un par de archivos JSON con las frecuencias de buses de Transmilenio SITP
HTML
1
star
49

questForInsights

A talk on how the real objective of big data is to discover insights, more than to have large data per se
JavaScript
1
star
50

flask-d3-treemap

A very simple example created in my class for demonstrating how to connect Flask + Sqlite3 and D3 for building a dynamic tree
JavaScript
1
star
51

bumpChart

a bump chart in d3
JavaScript
1
star
52

express-mongo-react-s3

A basic example of how to upload images from React to S3 using express and mongo
JavaScript
1
star
53

pythonClasses

Jupyter Notebook
1
star
54

resultadosSegundaVuelta2022_historia

Visualizaci贸n Storytelling de los resultados de la segunda Vuelta Presidencial 2022
JavaScript
1
star
55

webDevelopmentSlides

JavaScript
1
star
56

colombianSenateVotingPatterns

JavaScript
1
star
57

nodeExpressReactPassportLocal

Basic example of Node Express React and Passport-Local
JavaScript
1
star
58

nodeExpressEJSMongo

A basic example with server side rendering and AJAX connecting Node Express Mongo and EJS
JavaScript
1
star
59

nodeExpressReactBootstrapPagination

A simple example connecting node + express + react with bootstrap and fake pagination
JavaScript
1
star
60

nodeExpressExample

A sime node express example
HTML
1
star
61

datatonSenadoColombia

Datos abiertos de las leyes del senado de la rep煤blica de Colombia desde los 90s
Python
1
star
62

basicFlaskD3

HTML
1
star
63

nodeExpressMongo

A basic example of a node + Express + Mongo setup
JavaScript
1
star
64

nodeExpressReactMongoVite_photoSharing

A basic demo on how to combine react with node-express using vite and express generator but with es6 modules
JavaScript
1
star