Skip to content

Commit 197d6e2

Browse files
fully responsive legend component, optimized to match branch of d3 component
Co-authored-by: Alex Landeros <Alexander.Landeros1@gmail.com>
1 parent f4fef8c commit 197d6e2

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

src/app/components/History.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component, useEffect, useState } from 'react';
22
import * as d3 from 'd3';
3-
import LegendKey from './Legend';
3+
import LegendKey from './legend';
44
import { changeView, changeSlider } from '../actions/actions';
55
// import { useStoreContext } from '../store';
66
// import { string } from 'prop-types';

src/app/components/StateRoute.tsx

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import ComponentMap from './ComponentMap';
1717
// import PerfView from './PerfView';
1818
import AtomsRelationship from './AtomsRelationship.jsx';
1919
import PerformanceVisx from './PerformanceVisx';
20-
import ZoomI from './zoomFt';
20+
// import ZoomI from './zoomFt';
2121
// import History from './History'
2222

2323
import { changeView, changeSlider } from '../actions/actions';
@@ -81,23 +81,7 @@ const StateRoute = (props: StateRouteProps) => {
8181
//* we wrap History in a ParentSize div, in order to make use of Visx's Zoom functionality
8282
const renderHistory = () => {
8383
if (hierarchy) {
84-
// console.log(`width is ${width} and height is ${height}`);
85-
return (
86-
<div>
87-
<ParentSize>
88-
{({ width, height }) => (
89-
<History
90-
width={535}
91-
height={481}
92-
hierarchy={hierarchy}
93-
dispatch={dispatch}
94-
sliderIndex={sliderIndex}
95-
viewIndex={viewIndex}
96-
/>
97-
)}
98-
</ParentSize>
99-
</div>
100-
);
84+
return <History hierarchy={hierarchy} />;
10185
}
10286
return <div className="noState">{NO_STATE_MSG}</div>;
10387
};

src/app/components/legend.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type snapHierarchy = {`Record<string, unknown>`}
1111

1212
export default function LegendKey(props: snapHierarchy) {
1313
const { hierarchy } = props;
14-
console.log('which ends up being, hierarchy: ', hierarchy);
14+
// console.log('which ends up being, hierarchy: ', hierarchy);
1515

1616
// We are taking the array of displayNames and sifting through them and placing each set of
1717
// branches as a key in an object, { '.0': [1.0, 2.0, 3.0, 4.0], '.1': [1.1, 2.1, 3.1,...], '.2': [....]}
@@ -117,6 +117,7 @@ export default function LegendKey(props: snapHierarchy) {
117117
<style jsx>
118118
{`
119119
.legends {
120+
position: center;
120121
width: 25%;
121122
font-family: arial;
122123
font-weight: 900;

0 commit comments

Comments
 (0)