Skip to content

Commit 2161111

Browse files
committed
test
2 parents bac5a76 + 52f9d4a commit 2161111

25 files changed

+142
-110
lines changed

archive/.pre-v4-demo.gif.icloud

167 Bytes
Binary file not shown.

archive/pre-v4-demo.gif

-2.29 MB
Binary file not shown.

babel.config.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/app/components/AtomsRelationshipLegend.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
// @ts-nocheck
21
import React from 'react';
32
import { scaleOrdinal } from '@visx/scale';
43
import {
54
LegendOrdinal,
65
LegendItem,
76
LegendLabel,
7+
88
} from '@visx/legend';
99

10-
1110
const ordinalColorScale = scaleOrdinal({
1211
domain: ['Root', 'Selectors', 'Atoms', 'Components'],
1312
range: [ '#3BB78F', '#f0ece2', '#FED8B1', '#acdbdf'],
@@ -49,7 +48,7 @@ export default function Legend({ events = false }: { events?: boolean }) {
4948
)}
5049
</LegendOrdinal>
5150
</LegendDemo>
52-
<style jsx>
51+
<style>
5352
{`
5453
.legends {
5554
width: 25%;
@@ -66,12 +65,12 @@ export default function Legend({ events = false }: { events?: boolean }) {
6665
);
6766
}
6867

69-
function LegendDemo({ title, children }: { title: string; children: React.ReactNode }) {
68+
function LegendDemo({ title, children }: { title: string; children: JSX.Element }) {
7069
return (
7170
<div className="legend">
7271
<div className="title">{title}</div>
7372
{children}
74-
<style jsx>{`
73+
<style>{`
7574
.legend {
7675
position: absolute;
7776
top: 50;

src/app/components/ComponentMap.tsx

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
/* eslint-disable arrow-body-style */
2-
/* eslint-disable max-len */
3-
/* eslint-disable @typescript-eslint/no-explicit-any */
4-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
5-
/* eslint-disable @typescript-eslint/ban-types */
61
// @ts-nocheck
72
import React, { useState } from 'react';
83
import { Group } from '@visx/group';
@@ -15,6 +10,24 @@ import getLinkComponent from './getLinkComponent';
1510
import { onHover, onHoverExit } from '../actions/actions'
1611
import { useStoreContext } from '../store'
1712

13+
const root = hierarchy({
14+
name: 'root',
15+
children: [
16+
{ name: 'child #1' },
17+
{
18+
name: 'child #2',
19+
children: [{ name: 'grandchild #1' }, { name: 'grandchild #2' }, { name: 'grandchild #3' }],
20+
},
21+
],
22+
});
23+
interface TreeNode {
24+
name: string;
25+
isExpanded?: boolean;
26+
children?: TreeNode[];
27+
}
28+
29+
type HierarchyNode = HierarchyPointNode<TreeNode>;
30+
1831
const defaultMargin = { top: 30, left: 30, right: 30, bottom: 70 };
1932

2033
export type LinkTypesProps = {
@@ -35,13 +48,13 @@ export default function ComponentMap({
3548
const [{ tabs, currentTab }, dispatch] = useStoreContext();
3649
// This is where we select the last object in the snapshots array from props to allow hierarchy to parse the data for render on the component map per hierarchy layout specifications.
3750
const lastNode = snapshots.length - 1;
38-
const data = snapshots[lastNode];
51+
const data: {} = snapshots[lastNode];
3952
// importing custom hooks for the selection tabs.
40-
const [layout, setLayout] = useState<string>('cartesian');
41-
const [orientation, setOrientation] = useState<string>('horizontal');
42-
const [linkType, setLinkType] = useState<string>('diagonal');
53+
const [layout, setLayout] = useState('cartesian');
54+
const [orientation, setOrientation] = useState('horizontal');
55+
const [linkType, setLinkType] = useState('diagonal');
4356

44-
const [stepPercent, setStepPercent] = useState<number>(10);
57+
const [stepPercent, setStepPercent] = useState(10);
4558
// Declared this variable and assigned it to the useForceUpdate function that forces a state to change causing that component to re-render and display on the map
4659
const forceUpdate = useForceUpdate();
4760
// setting the margins for the Map to render in the tab window.
@@ -136,7 +149,7 @@ export default function ComponentMap({
136149
fill="url('#links-gradient')"
137150
onClick={() => {
138151
node.data.isExpanded = !node.data.isExpanded;
139-
console.log(node);
152+
// console.log(node);
140153
forceUpdate();
141154
}}
142155
/>

src/app/components/Diff.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
/* eslint-disable @typescript-eslint/ban-types */
44
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
55
/* eslint-disable react/require-default-props */
6-
// @ts-nocheck
76
import React from 'react';
87
import { diff, formatters } from 'jsondiffpatch';
98
import ReactHtmlParser from 'react-html-parser';

src/app/components/DiffRoute.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @ts-nocheck
21
import React from 'react';
32
import {
43
MemoryRouter as Router, Route, NavLink, Switch,

src/app/components/Dropdown.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @ts-nocheck
21
import React from 'react';
32
import Select from 'react-select';
43

src/app/components/ErrorHandler.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @ts-nocheck
21

32
/* eslint-disable react/prop-types */
43
/* eslint-disable semi */

src/app/components/History.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
// @ts-nocheck
21

32
import React, { Component, useEffect, useState } from 'react';
43
import * as d3 from 'd3';
54
import LegendKey from './legend';
6-
import { changeView, changeSlider } from '../actions/actions';
7-
5+
// import { changeView, changeSlider } from '../actions/actions';
86
/**
97
* @var colors: Colors array for the diffrerent node branches, each color is for a different branch
108
*/
@@ -79,6 +77,7 @@ function History(props: Record<string, unknown>) {
7977

8078
// d3.hierarchy constructs a root node from the specified hierarchical data
8179
// (our object titled dataset), which must be an object representing the root node
80+
8281
const hierarchy = d3.hierarchy(root);
8382
const tree = d3
8483
.tree()
@@ -152,12 +151,12 @@ function History(props: Record<string, unknown>) {
152151
d3.select(this).transition(90).duration(18).attr('r', 21);
153152
})
154153
.on('click', function (d: `Record<string, unknown>`) {
155-
const index = parseInt(`${d.data.name}.${d.data.branch}`);
156-
dispatch(changeSlider(index));
157-
dispatch(changeView(index));
154+
// const index = parseInt(`${d.data.name}.${d.data.branch}`);
155+
// dispatch(changeSlider(index));
156+
// dispatch(changeView(index));
158157
})
159158
// think about how I can convert this any to typescript
160-
.on('mouseout', function (d: any) {
159+
.on('mouseout', function () {
161160
d3.select(this).transition().duration(300).attr('r', 14);
162161
});
163162

0 commit comments

Comments
 (0)