mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-22 06:00:07 +03:00
Update redux-devtools-app
This commit is contained in:
parent
1379dd25a7
commit
6c4520a185
|
@ -1,3 +1,4 @@
|
|||
export type { HierarchyPointNode } from 'd3';
|
||||
export type { StyleValue } from 'd3tooltip';
|
||||
export { default as tree } from './tree/tree';
|
||||
export type { Node, Options } from './tree/tree';
|
||||
|
|
|
@ -52,7 +52,7 @@ export interface Options {
|
|||
widthBetweenNodesCoeff: number;
|
||||
transitionDuration: number;
|
||||
blinkDuration: number;
|
||||
onClickText: (datum: Node) => void;
|
||||
onClickText: (datum: HierarchyPointNode<Node>) => void;
|
||||
tooltipOptions: {
|
||||
disabled?: boolean;
|
||||
left?: number | undefined;
|
||||
|
@ -383,7 +383,7 @@ export default function (DOMNode: HTMLElement, options: Partial<Options> = {}) {
|
|||
.attr('dy', '.35em')
|
||||
.style('fill-opacity', 0)
|
||||
.text((d) => d.data.name)
|
||||
.on('click', (d) => onClickText(d.data));
|
||||
.on('click', onClickText);
|
||||
|
||||
const nodeEnterAndUpdate = nodeEnter.merge(node);
|
||||
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
export type { StyleValue } from 'd3tooltip';
|
||||
export { tree } from './charts';
|
||||
export type { Node, Options } from './charts';
|
||||
export type { HierarchyPointNode, Node, Options, StyleValue } from './charts';
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import React, { Component } from 'react';
|
||||
import { connect, ResolveThunks } from 'react-redux';
|
||||
import { ChartMonitor } from '@redux-devtools/chart-monitor';
|
||||
import { NodeWithId } from 'd3-state-visualizer';
|
||||
import type { HierarchyPointNode, Node } from 'd3-state-visualizer';
|
||||
import { selectMonitorWithState } from '../../actions';
|
||||
|
||||
export function getPath(obj: NodeWithId, inspectedStatePath: string[]) {
|
||||
export function getPath(obj: HierarchyPointNode<Node>, inspectedStatePath: string[]) {
|
||||
const parent = obj.parent;
|
||||
if (!parent) return;
|
||||
getPath(parent, inspectedStatePath);
|
||||
let name = obj.name;
|
||||
let name = obj.data.name;
|
||||
const item = /.+\[(\d+)]/.exec(name);
|
||||
if (item) name = item[1];
|
||||
inspectedStatePath.push(name);
|
||||
|
@ -20,7 +20,7 @@ type Props = DispatchProps;
|
|||
class ChartMonitorWrapper extends Component<Props> {
|
||||
static update = ChartMonitor.update;
|
||||
|
||||
onClickText = (data: NodeWithId) => {
|
||||
onClickText = (data: HierarchyPointNode<Node>) => {
|
||||
const inspectedStatePath: string[] = [];
|
||||
getPath(data, inspectedStatePath);
|
||||
this.props.selectMonitorWithState('InspectorMonitor', {
|
||||
|
|
Loading…
Reference in New Issue
Block a user