zz-chart
Advanced tools
Comparing version 0.1.1-beta.34 to 0.1.1-beta.35
@@ -60,3 +60,3 @@ import { get, isNumber } from 'lodash'; | ||
: Math.min(dataMin, min || 0); | ||
const defaultMax = dataMin === 0 && dataMax === 0 ? 1 : 0; | ||
const defaultMax = !dataMax && !dataMax ? 1 : 0; | ||
const maxV = Math.max(dataMax, max || defaultMax); | ||
@@ -63,0 +63,0 @@ return [minV, maxV > 1 ? maxV + 1 : maxV]; |
@@ -6,3 +6,3 @@ import { select } from 'd3'; | ||
import { createSvg, getChartColor, PolarShapeType, template, } from '../../utils/index.js'; | ||
import { ACTIVE_RADIUS_ENLARGE_SIZE, getRadius } from './pie.js'; | ||
import { getRadius } from './pie.js'; | ||
import { PolarShape } from './index.js'; | ||
@@ -84,2 +84,3 @@ const START_ANGLE = -(Math.PI / 1.5); | ||
const { clientWidth, clientHeight } = this.svgEl.node(); | ||
const radius = Math.min(clientWidth, clientHeight) / 2; | ||
const colors = this?.option?.colors | ||
@@ -106,9 +107,8 @@ ?.sort((a, b) => b[0] - a[0]) | ||
innerRadius: 0.95, | ||
outerRadius: this.option.outerRadius ?? | ||
clientHeight / 2 - ACTIVE_RADIUS_ENLARGE_SIZE, | ||
outerRadius: (this.option.outerRadius ?? radius), | ||
backgroundColor: this.colorVar['n-8'], | ||
}, this.colorVar['n-8']) | ||
: []; | ||
const outerRadius = this.option.outerRadius ?? clientHeight / 2 - ACTIVE_RADIUS_ENLARGE_SIZE; | ||
const innerRadius = this.option?.innerRadius || 0.8; | ||
const outerRadius = this.option.outerRadius ?? radius; | ||
const innerRadius = this.option?.innerRadius || 0.85; | ||
// const r = (END_ANGLE * 180) / Math.PI; | ||
@@ -131,3 +131,3 @@ // const padding = 8; | ||
innerRadius, | ||
outerRadius: outerRadius - 6, | ||
outerRadius: outerRadius - (radius * 0.08), | ||
backgroundColor: this.colorVar['n-8'], | ||
@@ -216,3 +216,3 @@ }, this.colorVar['n-8'], 0.01); | ||
: endAngle - startAngle; | ||
const angles = data.map(data => Math.max((data.value / total) * diffAngle, data.value === 0 ? 0 : angleMin || 0)); | ||
const angles = data.map(data => Math.max((data.value / total) * diffAngle, data.value === 0 ? 0 : angleMin || 0), 5); | ||
const { outerRadius, innerRadius } = getRadius(option); | ||
@@ -219,0 +219,0 @@ const { borderRadius = 2, borderWidth = 0 } = option?.itemStyle || {}; |
{ | ||
"name": "zz-chart", | ||
"version": "0.1.1-beta.34", | ||
"version": "0.1.1-beta.35", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Alauda Chart components by Alauda Frontend Team", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
19681
848302