Skip to content

Commit

Permalink
fix: 修复时间轴把手控件 (#157)
Browse files Browse the repository at this point in the history
* fix: 修复时间轴把手控件

* chore: set vis opacity

* chore: add path of trigger

* chore: update deps

* ci: upgrade node 18

* chore: getUId

* chore: upgrad version
  • Loading branch information
lvisei authored May 17, 2024
1 parent 9aaecd4 commit b9d4e9b
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 22 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ on:
push:
paths:
- 'packages/**'
- 'website/**'

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
node-version: 18

- name: Installation
run: |
Expand Down
2 changes: 1 addition & 1 deletion packages/li-analysis-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"start": "dumi dev"
},
"dependencies": {
"@antv/g2": "^5.0.14",
"@antv/g2": "^5.1.20",
"@antv/l7-draw": "^3.0.20",
"@antv/li-p2": "^1.8.1",
"@antv/li-sdk": "^1.4.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import { debounce } from 'lodash-es';
import React, { useEffect, useRef } from 'react';
import type { Selection } from '../TimeLinePanel/types';

const createPathRender = (compute: any) => {
function createPathRender(compute: any) {
return (group: any, options: any, document: any) => {
if (!group.handle) {
const path = document.createElement('path');
group.handle = path;
group.appendChild(group.handle);
}
const { handle } = group;
const { width, height, ...rest } = options;
const { x, y, width, height, ...rest } = options;
if (width === undefined || height === undefined) return handle;
handle.attr({ ...compute(width, height), ...rest });
handle.attr({ ...compute(x, y, width, height), ...rest });
return handle;
};
};
}

export type TimeLineChartProps = {
className?: string;
Expand Down Expand Up @@ -75,13 +75,13 @@ export const TimeLineChart = (props: TimeLineChartProps) => {
brushXHighlight: {
maskOpacity: 0.3,
maskFill: '#777',
maskHandleWRender: createPathRender((width: number, height: number) => ({
d: 'M-0.5,31.5c-2.5,0,-4.5,2,-4.5,4.5v30c0,2.5,2,4.5,4.5,4.5V31.5z',
transform: `translate(${width / 2}, -5)`,
maskHandleWRender: createPathRender((x: number, y: number, width: number, height: number) => ({
d: 'm4.5,-20c-2.5,0 -4.5,2 -4.5,4.5l0,30c0,2.5 2,4.5 4.5,4.5l0,-39z',
transform: `translate(${x}, ${y + height / 2})`,
})),
maskHandleERender: createPathRender((width: number, height: number) => ({
d: 'M0.5,31.5c2.5,0,4.5,2,4.5,4.5v30c0,2.5,-2,4.5,-4.5,4.5V31.5z',
transform: `translate(${width / 2}, -5)`,
maskHandleERender: createPathRender((x: number, y: number, width: number, height: number) => ({
d: 'm4.5,-18.7013c2.5,0 4.5,2 4.5,4.5l0,30c0,2.5 -2,4.5 -4.5,4.5l0,-39z',
transform: `translate(${x}, ${y + height / 2})`,
})),
maskHandleEFill: '#D3D8E0',
maskHandleWFill: '#D3D8E0',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PlusOutlined } from '@ant-design/icons';
import { getUniqueId } from '@antv/li-sdk';
import { usePrefixCls } from '@formily/antd-v5/esm/__builtins__';
import { Modal } from 'antd';
import cls from 'classnames';
Expand All @@ -10,6 +9,7 @@ import type { FilterConfigType, OptionType } from '../type';
import FilterContent from './FilterContent';
import FilterItem from './FilterItem';
import useStyle from './style';
import { getUId } from '../../../../utils';

export interface FilterModalProps {
/**
Expand Down Expand Up @@ -72,10 +72,10 @@ const FilterModal: React.FC<FilterModalProps> = (props) => {
};

const addFilterItem = () => {
const DEFAULTITEM = ({
id: getUniqueId(),
const DEFAULTITEM = {
id: getUId(),
field: undefined,
} as unknown) as FilterConfigType;
} as unknown as FilterConfigType;

const _filterList = [...filterList, DEFAULTITEM];
setFilterList(_filterList);
Expand All @@ -99,10 +99,10 @@ const FilterModal: React.FC<FilterModalProps> = (props) => {
setFilterList(value);
setSelectedFilterNode(value?.[0] || []);
} else {
const DEFAULTITEM = ({
id: getUniqueId(),
const DEFAULTITEM = {
id: getUId(),
field: undefined,
} as unknown) as FilterConfigType;
} as unknown as FilterConfigType;

setFilterList([DEFAULTITEM]);
setSelectedFilterNode(DEFAULTITEM);
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@difizen/weave-summary-row": "^0.0.1-alpha.3",
"@ant-design/icons": "^5.0.1",
"@antv/g2plot": "^2.4.31",
"@antv/l7": "^2.21.11-beta.0",
"@antv/l7": "^2.21.11-beta.1",
"@antv/larkmap": "^1.4.11",
"@antv/li-analysis-assets": "^1.0.5",
"@antv/li-core-assets": "^1.0.5",
Expand Down
2 changes: 1 addition & 1 deletion website/src/constants/cases/cyberspace-pattern/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const APP_CONFIG: Application = {
},
visConfig: {
fillColor: '#7b807d',
opacity: 0.7,
opacity: 0.5,
strokeColor: '#232424',
lineWidth: 1,
lineOpacity: 0.2,
Expand Down

0 comments on commit b9d4e9b

Please sign in to comment.