Skip to content

Commit

Permalink
fix: fixed size change
Browse files Browse the repository at this point in the history
  • Loading branch information
islxyqwe committed Aug 28, 2024
1 parent 436e7bf commit c889381
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/graphic-walker/src/vis/react-vega.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ const ReactVega = forwardRef<IReactVegaHandler, ReactVegaProps>(function ReactVe
const renderTaskRefs = useRef<Promise<unknown>[]>([]);
const { width: areaWidth, height: areaHeight, ref: areaRef } = useResizeDetector();

const vegaWidth = layoutMode === 'auto' ? 0 : areaWidth || width;
const vegaHeight = layoutMode === 'auto' ? 0 : areaHeight || height;
const vegaWidth = layoutMode === 'auto' ? 0 : layoutMode === 'full' ? areaWidth || width : width;
const vegaHeight = layoutMode === 'auto' ? 0 : layoutMode === 'full' ? areaHeight || height : height;

const specs = useMemo(
() =>
Expand Down Expand Up @@ -382,7 +382,10 @@ const ReactVega = forwardRef<IReactVegaHandler, ReactVegaProps>(function ReactVe
for (let i = 0; i < leastOne(rowRepeatFields.length); i++) {
for (let j = 0; j < leastOne(colRepeatFields.length); j++, index++) {
const sourceId = index;
const node = i * leastOne(colRepeatFields.length) + j < viewPlaceholders.length ? viewPlaceholders[i * leastOne(colRepeatFields.length) + j].current : null;
const node =
i * leastOne(colRepeatFields.length) + j < viewPlaceholders.length
? viewPlaceholders[i * leastOne(colRepeatFields.length) + j].current
: null;
const ans = specs[index];
if (node) {
const id = index;
Expand Down

0 comments on commit c889381

Please sign in to comment.