mim-graph
is a graph visualization for the Music in Movement project.
Please note: This repository only includes the visualization source code, not the complete Music in Movement dataset.
Clone the repository and change the config in src/Config.js
to match your data endpoints. To make this visualization match your needs; you can also customize files like src/Components/Help/Help.js
, src/Components/App/types.scss
.
From your command line run:
yarn install
-- installs the required packagesyarn run scss
-- starts the SCSS compiler watchyarn start
-- compiles the application and opens a browser athttp://localhost:3000
.
Include mim-graph
on your page:
<link href="mim/mim-graph.css" rel="stylesheet" type="text/css" />
<script src="mim/mim-graph.js"></script>
Set UTF-8 as the required charset:
<meta charset="utf-8">
The library will automatically initialize on window.onload
and inject the visualization in all elements with the class mim-graph
.
Auto initializing can be prevented by setting
window.MiMGraphAutoLoad=false;
beforewindow.onload
is triggered.
Graph with focus on a specific entity with id composer-louis-andriessen
:
<div class="mim-graph" data-node-id="composer-louis-andriessen"></div>
Graph with focus on a specific entity with id composer-louis-andriessen
and height 600
px:
<div class="mim-graph" data-height="600" data-node-id="composer-louis-andriessen"></div>
Height defaults to 800 and is limited by window.innerHeight
Full graph:
<div class="mim-graph"></div>
The active node of the visualisation can be changed by sending a MIM_GRAPH_SET_ACTIVE_NODE
event to the window
with detail parameter: {detail: {nodeId: "composer-louis-andriessen"}}
In order to prevent conflicts with other code on the host page, mimgraph
is limited to the following namespaces:
- CSS styling of the graph visualization has
.mim-graph
as root class. - The Javascript is embedded in the object
MiMGraph
The music in movement dataset has been excluded from this repository. Check MiMGraph.js
for an example of the data format
License is provided in the file LICENSE
.