Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregation fix #3

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor/
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,55 @@
# data_viz
This module allows for the representation of JSON data in two types of diagrams.
1. Network Diagram
2. Kinship Diagram
## Requirements
This module requires Drupal core 8.8 and above.
## Installation and Configuration
Clone the repository into your Drupal modules folder or install with Composer. Enable the module and define a new view mode for Media, and then change the viewer for file in Media Types to show diagram of your choice.
## Expected Form of Input JSON file
### Kinship
- `start` which identifies which node is the starting node
- `persons` which contains all the node data as a dictionary
- Each entry is a node ID (i.e. `I0127`)
- `id` String
- `class` String
- `forename` String
- `surname` String
- `PID` String
- `portrait` String
- `birthyear` String
- `deathyear` String
- `own_unions` Array[String]
- `parent_union` String
- `familyColor` String
- `unions` a dictionary of the unions and the nodes they connect
- Each entry is a link ID (i.e. `F0001`)
- `id` String
- `partner` Array[String]
- `children` Array[String]
- `links` a 2D array linking unions to persons
- Each entry is an Array[String] that contains two strings
- {`union ID`}
- {`node ID`}
- `startExpanded` an Array[String] which correspond to nodes which should be expanded initially
- `startExpandedIds` a 2D array to allow custom behavior of expanding a node but only making a specific node visible
- Each entry contains two strings, one of the node to expand, one of the union corresponding to the node you wish to make visible
- `startX` an Integer multiplier, corresponding to the starting x coordinate of the root node. Formula is screen width * `startX`
- `startY` similar but for y coordinates

### Network
- `nodes` An array of dictionaries
- `id` Integer
- `label` String
- `dragoman_count` Integer
- `node_size` Integer
- `subjecthood` String
- `dragoman_service` String
- `Polygon` Integer
- `employed in Instanbul? (only include if y)` "y"/"n"
- `links` An array of dictionaries
- `source` Integer
- `target` Integer
- `weight` Integer


13 changes: 13 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "drupal/data_viz",
"description": "A visualization of Network and Kinship diagrams given a JSON file.",
"type": "drupal-module",
"license": "GPL-3.0",
"authors": [
{
"name": "homura163",
"email": "[email protected]"
}
],
"require": {}
}
22 changes: 20 additions & 2 deletions js/d3-dag.min.js
100755 → 100644

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions js/d3.v5.min.js

This file was deleted.

Loading