Skip to content

Commit

Permalink
Merge branch 'main' into edge
Browse files Browse the repository at this point in the history
  • Loading branch information
NewJerseyStyle authored Oct 11, 2024
2 parents a143757 + f59e20d commit ca385f3
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 44 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/release-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
branches:
- main
- edge
pull_request:
branches:
- main

jobs:
build:
Expand All @@ -30,11 +33,16 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.CR_PAT }}

- name: Build full project via docker-compose
run: docker compose --profile postgres build --parallel --build-arg GIT_HASH=${GITHUB_SHA:0:6}
run: |
mv example.env .env
sed -i 's/docker.io/ghcr.io/g' docker-compose.yml
sed -i 's/compdem/civictechto/g' docker-compose.yml
docker compose --profile postgres build --parallel --build-arg GIT_HASH=${GITHUB_SHA:0:6}
- name: Push images to Docker Hub
run: docker compose --profile postgres push --ignore-push-failures
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ For a detailed methods paper, see [Polis: Scaling Deliberation by Mapping High D
[methods-paper]: https://www.e-revistes.uji.es/index.php/recerca/article/view/5516/6558

<!-- Changes to badge text in URLs below, require changes to "name" value in .github/workflows/*.yml -->
[![Docker Image Builds](https://github.com/compdemocracy/polis/workflows/Docker%20image%20builds/badge.svg)][docker-image-builds]
[![Docker Image Builds](https://github.com/CivicTechTO/polis/workflows/Docker%20image%20builds/badge.svg)][docker-image-builds]
[![E2E Tests](https://github.com/CivicTechTO/polis/workflows/E2E%20Tests/badge.svg)][e2e-tests]

[docker-image-builds]: https://hub.docker.com/u/compdem
[docker-image-builds]: https://hub.docker.com/u/newjerseystyle
[e2e-tests]: https://github.com/CivicTechTO/polis/actions?query=workflow%3A%22E2E+Tests%22

---
Expand Down
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 ca385f3

Please sign in to comment.