diff --git a/package-lock.json b/package-lock.json index 61353b5..cd0990a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "aoe_technology_radar", - "version": "3.3.4", + "version": "3.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "aoe_technology_radar", - "version": "3.3.4", + "version": "3.4.0", "license": "Apache-2.0", "dependencies": { "@apideck/better-ajv-errors": "0.3.6", diff --git a/src/components/Chart/QuadrantRings.tsx b/src/components/Chart/QuadrantRings.tsx index f520c8f..12ee6de 100644 --- a/src/components/Chart/QuadrantRings.tsx +++ b/src/components/Chart/QuadrantRings.tsx @@ -4,20 +4,20 @@ import React from "react"; import { ConfigData } from "../../config"; import { QuadrantConfig } from "../../model"; +const arcAngel = [ + [(3 * Math.PI) / 2, (4 * Math.PI) / 2], + [0, Math.PI / 2], + [Math.PI, Math.PI * 3 / 2], + [Math.PI / 2, Math.PI], +]; + function arcPath( quadrantPosition: number, ringPosition: number, xScale: d3.ScaleLinear, config: ConfigData ) { - const startAngle = - quadrantPosition === 1 - ? (3 * Math.PI) / 2 - : ((quadrantPosition - 2) * Math.PI) / 2; - const endAngle = - quadrantPosition === 1 - ? (4 * Math.PI) / 2 - : ((quadrantPosition - 1) * Math.PI) / 2; + const [startAngle, endAngle] = arcAngel[quadrantPosition - 1]; const arcAttrs = config.chartConfig.ringsAttributes[ringPosition], ringRadiusPx = xScale(arcAttrs.radius) - xScale(0), arc = d3.arc(); @@ -41,8 +41,8 @@ const QuadrantRings: React.FC<{ const gradientAttributes = [ { x: 0, y: 0, cx: 1, cy: 1, r: 1 }, { x: xScale(0), y: 0, cx: 0, cy: 1, r: 1 }, - { x: xScale(0), y: xScale(0), cx: 0, cy: 0, r: 1 }, { x: 0, y: xScale(0), cx: 1, cy: 0, r: 1 }, + { x: xScale(0), y: xScale(0), cx: 0, cy: 0, r: 1 }, ]; const gradientId = `${quadrant.position}-radial-gradient`, quadrantSize = config.chartConfig.size / 2; diff --git a/src/components/Chart/RadarChart.tsx b/src/components/Chart/RadarChart.tsx index f4cbd2a..3155e32 100644 --- a/src/components/Chart/RadarChart.tsx +++ b/src/components/Chart/RadarChart.tsx @@ -75,6 +75,10 @@ const RadarChart: React.FC<{ + {Object.values(config.quadrantsMap).map((value, index) => { + console.log(value) + return null + })} {Object.values(config.quadrantsMap).map((value, index) => (