Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
thomassth authored and ballPointPenguin committed Oct 17, 2024
1 parent c60752b commit c9360ba
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 39 deletions.
33 changes: 25 additions & 8 deletions client-report/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client-report/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"dependencies": {
"color": "~4.2.3",
"d3": "~4.6.0",
"d3-contour": "~1.1.2",
"d3-contour": "^4.0.2",
"d3-scale-chromatic": "~1.1.1",
"hull.js": "~0.2.11",
"jquery": "~3.6.3",
Expand Down
58 changes: 28 additions & 30 deletions client-report/src/components/participantsGraph/participantsGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import _ from "lodash";
import * as globals from "../globals";
import graphUtil from "../../util/graphUtil";
import Axes from "../graphAxes";
import * as d3contour from "d3-contour";
import * as d3chromatic from "d3-scale-chromatic";
import { scaleSequential, geoPath } from 'd3'
import { contourDensity } from "d3-contour";
import { interpolateYlGnBu } from "d3-scale-chromatic";
// import GroupLabels from "./groupLabels";
import Comments from "../commentsGraph/comments";
import Hull from "./hull";
Expand All @@ -16,10 +17,8 @@ const pointsPerSquarePixelMax = 0.0017; /* choose dynamically ? */
const contourBandwidth = 20;
const colorScaleDownFactor = 0.5; /* The colors are too dark. This helps. */

const color = d3
.scaleSequential(d3chromatic.interpolateYlGnBu)
const color = scaleSequential(interpolateYlGnBu)
.domain([0, pointsPerSquarePixelMax]);
const geoPath = d3.geoPath();

const Contour = ({ contour }) => (
<path fill={color(contour.value * colorScaleDownFactor)} d={geoPath(contour)} />
Expand Down Expand Up @@ -117,8 +116,7 @@ class ParticipantsGraph extends React.Component {
hulls,
} = graphUtil(this.props.comments, this.props.math, this.props.badTids);

const contours = d3contour
.contourDensity()
const contours = contourDensity()
.x(function (d) {
return d.x;
})
Expand Down Expand Up @@ -377,14 +375,14 @@ class ParticipantsGraph extends React.Component {
) : null}
{this.state.showGroupOutline
? hulls.map((hull) => {
let gid = hull.group[0].gid;
if (_.isNumber(this.props.showOnlyGroup)) {
if (gid !== this.props.showOnlyGroup) {
return "";
}
let gid = hull.group[0].gid;
if (_.isNumber(this.props.showOnlyGroup)) {
if (gid !== this.props.showOnlyGroup) {
return "";
}
return <Hull key={gid} hull={hull} />;
})
}
return <Hull key={gid} hull={hull} />;
})
: null}
{this.state.showParticipants ? (
<Participants math={this.props.math} points={baseClustersScaled} />
Expand All @@ -405,25 +403,25 @@ class ParticipantsGraph extends React.Component {
) : null}
{this.state.showGroupLabels
? this.props.math["group-clusters"].map((g, i) => {
// console.log('g',g )
return (
<text
key={i}
transform={`translate(
// console.log('g',g )
return (
<text
key={i}
transform={`translate(
${xx(g.center[0])},
${yy(g.center[1])}
)`}
style={{
fill: "rgba(0,0,0,.5)",
fontFamily: "Helvetica",
fontWeight: 700,
fontSize: 18,
}}
>
{globals.groupLabels[g.id]}
</text>
);
})
style={{
fill: "rgba(0,0,0,.5)",
fontFamily: "Helvetica",
fontWeight: 700,
fontSize: 18,
}}
>
{globals.groupLabels[g.id]}
</text>
);
})
: null}
{this.state.consensusDivisionColorScale ? (
<g id="Page-1" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
Expand Down

0 comments on commit c9360ba

Please sign in to comment.