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(HotMap): 更新HotMap字体颜色 #381

Merged
merged 1 commit into from
Apr 11, 2024
Merged
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
1 change: 1 addition & 0 deletions src/hot-map/demos/HotMap.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ const BaseHotMapArgs = {
offsetY: 62,
fixedOffsetY: 100,
},
className: 'custom-tooltip-class',
render(options) {
const { data, onClick } = options;
const sourceData = data?.[0]?.data;
Expand Down
4 changes: 2 additions & 2 deletions src/hot-map/framework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export class HotMap extends BaseChart {
style: {
fill: '#fff',
fontSize: 14,
shadowBlur: 2,
shadowColor: 'rgba(0, 0, 0, .45)',
// shadowBlur: 2,
shadowColor: 'rgba(0, 0, 0)',
},
content: (val) => {
return `${formatPercent(val?.[zField] || 0)}`;
Expand Down
6 changes: 4 additions & 2 deletions src/info-card/InfoCardBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState, useMemo } from 'react';
import { ChartConfig, ChartOptions, Legends, Legend, ChartType } from '../interfaces';
import { getInfoCardStyles, getLegendStyles } from '../utils/styles';
import InfoCard from './InfoCard';
import { debounce, first, last, set } from 'lodash';
import { debounce, first, get, last, set } from 'lodash';

import './styles/infocard.less';
import { LooseObject } from '@antv/g-base';
Expand Down Expand Up @@ -52,6 +52,8 @@ const InfoCardBox = (props: InfoCardProps) => {
const [title, setTitle] = useState('');
const setHoverItemD = useMemo(() => debounce(setItems, 20), [setItems]);

const tipClassName = get(config, 'tooltip.className');

const [, update] = useState(0);

const triggerInfo = getTrigger?.();
Expand Down Expand Up @@ -123,7 +125,7 @@ const InfoCardBox = (props: InfoCardProps) => {
// That is expected to update items, it seams it's better to direct use without useEffect.
return (
<div
className={`gio-d-charts-infocard `}
className={`gio-d-charts-infocard ${tipClassName}`}
data-testid="infoCardBox"
onMouseLeave={onMouseLeave}
style={{ maxHeight: (height - 60) * 0.75 }}
Expand Down
Loading