Skip to content

Commit

Permalink
chore: move pixi files from graph to data-display (#1230)
Browse files Browse the repository at this point in the history
  • Loading branch information
kswenson authored Apr 24, 2024
1 parent c4b28d2 commit ebd9454
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion v3/src/components/data-display/components/background.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {defaultBackgroundColor} from "../../../utilities/color-utils"
import {rTreeRect} from "../data-display-types"
import {rectangleSubtract, rectNormalize} from "../data-display-utils"
import {IPixiPointMetadata, IPixiPointsArrayRef, PixiBackgroundPassThroughEvent, PixiPoints}
from "../../graph/utilities/pixi-points"
from "../pixi/pixi-points"
import {IDataSet} from "../../../models/data/data-set"
import {MarqueeState} from "../models/marquee-state"
import {appState} from "../../../models/app-state"
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/data-display/components/data-tip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Fragment, useCallback, useEffect, useRef, useState } from "react
import * as PIXI from "pixi.js"
import { computePosition, offset, useFloating } from "@floating-ui/react"
import { IDataSet } from "../../../models/data/data-set"
import {IPixiPointMetadata, PixiPoints} from "../../graph/utilities/pixi-points"
import {IPixiPointMetadata, PixiPoints} from "../pixi/pixi-points"
import { urlParams } from "../../../utilities/url-params"
import { IDataConfigurationModel } from "../models/data-configuration-model"
import { IGetTipTextProps } from "../data-tip-types"
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/data-display/data-display-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
pointRadiusSelectionAddend, Rect, rTreeRect
} from "./data-display-types"
import {ISetPointSelection} from "../graph/utilities/graph-utils"
import {IPixiPointStyle, PixiPoints} from "../graph/utilities/pixi-points"
import {IPixiPointStyle, PixiPoints} from "./pixi/pixi-points"
import { IBarCover } from "../graph/graphing-types"

export const maxWidthOfStringsD3 = (strings: Iterable<string>) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { curveLinear, line, select } from "d3"
import { tip as d3tip } from "d3-v6-tip"
import { useCallback } from "react"
import { useDataConfigurationContext } from "./use-data-configuration-context"
import { PixiBackgroundPassThroughEvent, PixiPoints } from "../../graph/utilities/pixi-points"
import { PixiBackgroundPassThroughEvent, PixiPoints } from "../pixi/pixi-points"
import { t } from "../../../utilities/translation/translate"
import { IConnectingLineDescription, transitionDuration } from "../data-display-types"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useRef } from "react"
import { PixiPoints } from "../../graph/utilities/pixi-points"
import { PixiPoints } from "../pixi/pixi-points"

interface IProps {
addInitialPixiPoints?: boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as PIXI from "pixi.js"
import { CaseData } from "../../data-display/d3-types"
import { CaseData } from "../d3-types"
import { PixiTransition, TransitionPropMap, TransitionProp } from "./pixi-transition"
import { hoverRadiusFactor, transitionDuration } from "../../data-display/data-display-types"
import { hoverRadiusFactor, transitionDuration } from "../data-display-types"
import { isFiniteNumber } from "../../../utilities/math-utils"

const DEFAULT_Z_INDEX = 0
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/graph/components/binneddotplotdots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {useGraphDataConfigurationContext} from "../hooks/use-graph-data-configur
import {useDataSetContext} from "../../../hooks/use-data-set-context"
import {useGraphContentModelContext} from "../hooks/use-graph-content-model-context"
import {useGraphLayoutContext} from "../hooks/use-graph-layout-context"
import {circleAnchor} from "../utilities/pixi-points"
import {circleAnchor} from "../../data-display/pixi/pixi-points"
import { setPointCoordinates } from "../utilities/graph-utils"
import { useInstanceIdContext } from "../../../hooks/use-instance-id-context"
import { computeBinPlacements, computePrimaryCoord, computeSecondaryCoord, adjustCoordForStacks,
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/graph/components/casedots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {useDataSetContext} from "../../../hooks/use-data-set-context"
import {useGraphContentModelContext} from "../hooks/use-graph-content-model-context"
import {useGraphLayoutContext} from "../hooks/use-graph-layout-context"
import {setPointCoordinates} from "../utilities/graph-utils"
import {IPixiPointMetadata, PixiPoints} from "../utilities/pixi-points"
import {IPixiPointMetadata, PixiPoints} from "../../data-display/pixi/pixi-points"

export const CaseDots = function CaseDots(props: {
pixiPoints?: PixiPoints
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/graph/components/dot-chart-points.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { PlotProps } from "../graphing-types"
import { useChartDots } from "../hooks/use-chart-dots"
import { usePlotResponders } from "../hooks/use-plot"
import { setPointCoordinates } from "../utilities/graph-utils"
import { IPixiPointMetadata, PixiPointEventHandler } from "../utilities/pixi-points"
import { IPixiPointMetadata, PixiPointEventHandler } from "../../data-display/pixi/pixi-points"

export const DotChartPoints = observer(function DotChartPoints({ pixiPoints }: PlotProps) {
const { dataset, graphModel, isAnimating, primaryScreenCoord, secondaryScreenCoord,
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/graph/components/freedotplotdots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {useDataSetContext} from "../../../hooks/use-data-set-context"
import {useGraphContentModelContext} from "../hooks/use-graph-content-model-context"
import {useGraphLayoutContext} from "../hooks/use-graph-layout-context"
import {setNiceDomain, setPointCoordinates} from "../utilities/graph-utils"
import {circleAnchor, hBarAnchor, vBarAnchor} from "../utilities/pixi-points"
import {circleAnchor, hBarAnchor, vBarAnchor} from "../../data-display/pixi/pixi-points"
import { computeBinPlacements, computePrimaryCoord, computeSecondaryCoord } from "../utilities/dot-plot-utils"
import { useDotPlotDragDrop } from "../hooks/use-dot-plot-drag-drop"
import { AxisPlace } from "../../axis/axis-types"
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/graph/components/graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {select} from "d3"
import {clsx} from "clsx"
import {mstReaction} from "../../../utilities/mst-reaction"
import {onAnyAction} from "../../../utilities/mst-utils"
import {IPixiPointsArrayRef} from "../utilities/pixi-points"
import {IPixiPointsArrayRef} from "../../data-display/pixi/pixi-points"
import {GraphAttrRole, attrRoleToGraphPlace, graphPlaceToAttrRole, kPortalClass}
from "../../data-display/data-display-types"
import {AxisPlace, AxisPlaces} from "../../axis/axis-types"
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/graph/components/scatterdots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {useInstanceIdContext} from "../../../hooks/use-instance-id-context"
import {ICase} from "../../../models/data/data-set-types"
import {ISquareOfResidual} from "../adornments/shared-adornment-types"
import { scatterPlotFuncs } from "./scatter-plot-utils"
import { IPixiPointMetadata } from "../utilities/pixi-points"
import { IPixiPointMetadata } from "../../data-display/pixi/pixi-points"
import { useConnectingLines } from "../../data-display/hooks/use-connecting-lines"
import { transitionDuration } from "../../data-display/data-display-types"

Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/graph/graphing-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PixiPoints } from "./utilities/pixi-points"
import { PixiPoints } from "../data-display/pixi/pixi-points"

export interface PlotProps {
pixiPoints?: PixiPoints
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/graph/hooks/use-chart-dots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useDataSetContext } from "../../../hooks/use-data-set-context"
import { setPointSelection } from "../../data-display/data-display-utils"
import { useDataDisplayAnimation } from "../../data-display/hooks/use-data-display-animation"
import { SubPlotCells } from "../models/sub-plot-cells"
import { PixiPoints } from "../utilities/pixi-points"
import { PixiPoints } from "../../data-display/pixi/pixi-points"
import { useGraphContentModelContext } from "./use-graph-content-model-context"
import { useGraphDataConfigurationContext } from "./use-graph-data-configuration-context"
import { useGraphLayoutContext } from "./use-graph-layout-context"
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/graph/hooks/use-dot-plot-drag-drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useDataDisplayAnimation } from "../../data-display/hooks/use-data-displ
import { useGraphDataConfigurationContext } from "./use-graph-data-configuration-context"
import { useDataSetContext } from "../../../hooks/use-data-set-context"
import { ScaleLinear } from "d3"
import { IPixiPointMetadata } from "../utilities/pixi-points"
import { IPixiPointMetadata } from "../../data-display/pixi/pixi-points"
import { appState } from "../../../models/app-state"
import { handleClickOnCase } from "../../data-display/data-display-utils"
import { useRef, useState } from "react"
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/graph/hooks/use-graph-controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {useEffect} from "react"
import {GraphController} from "../models/graph-controller"
import {IGraphContentModel} from "../models/graph-content-model"
import {IPixiPointsArrayRef} from "../utilities/pixi-points"
import {IPixiPointsArrayRef} from "../../data-display/pixi/pixi-points"

export interface IUseGraphControllerProps {
graphController: GraphController,
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/graph/hooks/use-graph-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {onAnyAction} from "../../../utilities/mst-utils"
import {useDataSetContext} from "../../../hooks/use-data-set-context"
import {matchCirclesToData} from "../../data-display/data-display-utils"
import {setNiceDomain} from "../utilities/graph-utils"
import {PixiPoints} from "../utilities/pixi-points"
import {PixiPoints} from "../../data-display/pixi/pixi-points"
import {IGraphContentModel} from "../models/graph-content-model"
import {INumericAxisModel} from "../../axis/models/axis-model"

Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/graph/hooks/use-plot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {useGraphContentModelContext} from "./use-graph-content-model-context"
import {useGraphLayoutContext} from "./use-graph-layout-context"
import {IAxisModel} from "../../axis/models/axis-model"
import {useInstanceIdContext} from "../../../hooks/use-instance-id-context"
import { PixiPointEventHandler, PixiPoints } from "../utilities/pixi-points"
import { PixiPointEventHandler, PixiPoints } from "../../data-display/pixi/pixi-points"

export interface IPixiDragHandlers {
start: PixiPointEventHandler
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/graph/models/graph-controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {getDataSetFromId} from "../../../models/shared/shared-data-utils"
import {axisPlaceToAttrRole, graphPlaceToAttrRole} from "../../data-display/data-display-types"
import {matchCirclesToData} from "../../data-display/data-display-utils"
import {PixiPoints} from "../utilities/pixi-points"
import {PixiPoints} from "../../data-display/pixi/pixi-points"
import {setNiceDomain} from "../utilities/graph-utils"
import {IGraphContentModel} from "./graph-content-model"
import {GraphLayout} from "./graph-layout"
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/graph/utilities/graph-utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {extent, format} from "d3"
import {isInteger} from "lodash"
import * as PIXI from "pixi.js"
import {IPixiPointMetadata, PixiPoints} from "./pixi-points"
import {IPixiPointMetadata, PixiPoints} from "../../data-display/pixi/pixi-points"
import {IDataSet} from "../../../models/data/data-set"
import {CaseData} from "../../data-display/d3-types"
import {Point, PointDisplayType, transitionDuration} from "../../data-display/data-display-types"
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/map/components/map-background.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useMemo } from "use-memo-one"
import { Background } from "../../data-display/components/background"
import { Marquee } from "../../data-display/components/marquee"
import { MarqueeState } from "../../data-display/models/marquee-state"
import { IPixiPointsArrayRef } from "../../graph/utilities/pixi-points"
import { IPixiPointsArrayRef } from "../../data-display/pixi/pixi-points"
import { IMapContentModel } from "../models/map-content-model"
import { mstReaction } from "../../../utilities/mst-reaction"

Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/map/components/map-interior.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {observer} from "mobx-react-lite"
import React, {useCallback} from "react"
import {PixiPoints} from "../../graph/utilities/pixi-points"
import {PixiPoints} from "../../data-display/pixi/pixi-points"
import {useMapModelContext} from "../hooks/use-map-model-context"
import {useMapModel} from "../hooks/use-map-model"
import {kMapPointLayerType, kMapPolygonLayerType} from "../map-types"
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/map/components/map-point-layer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {isDisplayItemVisualPropsAction} from "../../data-display/models/display-
import {useDataDisplayAnimation} from "../../data-display/hooks/use-data-display-animation"
import {useDataDisplayLayout} from "../../data-display/hooks/use-data-display-layout"
import {latLongAttributesFromDataSet} from "../utilities/map-utils"
import {IPixiPointMetadata, PixiPoints} from "../../graph/utilities/pixi-points"
import {IPixiPointMetadata, PixiPoints} from "../../data-display/pixi/pixi-points"
import {useMapModelContext} from "../hooks/use-map-model-context"
import {IMapPointLayerModel} from "../models/map-point-layer-model"
import {MapPointGrid} from "./map-point-grid"
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/map/components/map-polygon-layer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {DEBUG_MAP, debugLog} from "../../../lib/debug"
import {isSelectionAction, isSetCaseValuesAction} from "../../../models/data/data-set-actions"
import {transitionDuration} from "../../data-display/data-display-types"
import {handleClickOnCase} from "../../data-display/data-display-utils"
import { PixiBackgroundPassThroughEvent } from "../../graph/utilities/pixi-points"
import { PixiBackgroundPassThroughEvent } from "../../data-display/pixi/pixi-points"
import {useDataDisplayLayout} from "../../data-display/hooks/use-data-display-layout"
import {useMapModelContext} from "../hooks/use-map-model-context"
import {IMapPolygonLayerModel} from "../models/map-polygon-layer-model"
Expand Down
4 changes: 2 additions & 2 deletions v3/src/models/history/apply-model-change.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface INotification {
message: DIMessage
callback?: iframePhone.ListenerCallback
}
export interface IApplyActionOptions {
export interface IApplyModelChangeOptions {
notification?: INotification | (() => INotification)
redoStringKey?: string
undoStringKey?: string
Expand All @@ -19,7 +19,7 @@ export interface IApplyActionOptions {
export function applyModelChange(self: IAnyStateTreeNode) {
return ({
// performs the specified action so that response actions are included and undo/redo strings assigned
applyModelChange<TResult = unknown>(actionFn: () => TResult, options?: IApplyActionOptions) {
applyModelChange<TResult = unknown>(actionFn: () => TResult, options?: IApplyModelChangeOptions) {
const result = actionFn()

// Add strings to undoable action or keep out of the undo stack
Expand Down

0 comments on commit ebd9454

Please sign in to comment.