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

fix build error #1800

Open
wants to merge 1 commit into
base: edge
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
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
Loading