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

chore(deps): update all non-major dependencies #4108

Merged
merged 2 commits into from
Jan 21, 2025
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
12 changes: 6 additions & 6 deletions frontend/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"please-use-pnpm": "^1.1.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-router-dom": "7.1.1",
"react-router-dom": "7.1.3",
"react-use": "^17.5.0",
"reactflow": "11.11.4",
"tailwindcss": "^3.3.3",
Expand All @@ -85,20 +85,20 @@
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0",
"@types/node": "^22.4.1",
"@types/react": "19.0.2",
"@types/react-dom": "19.0.2",
"@types/react": "19.0.7",
"@types/react-dom": "19.0.3",
"@vitest/ui": "^2.0.5",
"buffer": "^6.0.3",
"chokidar": "4.0.3",
"fast-glob": "3.3.3",
"jsdom": "^25.0.0",
"lint-staged": "15.3.0",
"postcss": "8.4.49",
"lint-staged": "15.4.1",
"postcss": "8.5.1",
"postcss-nesting": "13.0.1",
"storybook": "^8.2.7",
"storybook-dark-mode": "^4.0.2",
"typed-css-modules": "0.9.1",
"typescript": "5.7.2",
"typescript": "5.7.3",
"vite": "^6.0.0",
"vitest": "^2.0.5"
}
Expand Down
16 changes: 10 additions & 6 deletions frontend/console/src/features/graph/GraphPane.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import cytoscape from 'cytoscape'
import type { FcoseLayoutOptions } from 'cytoscape-fcose'
import type { LayoutOptions } from 'cytoscape'
import fcose from 'cytoscape-fcose'
import type { FcoseLayoutOptions } from 'cytoscape-fcose'

import { useEffect, useRef, useState } from 'react'
import type React from 'react'
Expand All @@ -9,8 +10,12 @@ import { useUserPreferences } from '../../providers/user-preferences-provider'
import { createGraphStyles } from './graph-styles'
import { type FTLNode, getGraphData } from './graph-utils'

// @ts-ignore - Known type incompatibility with cytoscape plugins
cytoscape.use(fcose)

// Add this type intersection
type CytoscapeFcoseLayout = LayoutOptions & FcoseLayoutOptions

interface GraphPaneProps {
onTapped?: (item: FTLNode | null, moduleName: string | null) => void
}
Expand Down Expand Up @@ -189,24 +194,23 @@ export const GraphPane: React.FC<GraphPaneProps> = ({ onTapped }) => {
})

if (hasNewNodesWithoutPositions) {
const layoutOptions = {
const layoutOptions: CytoscapeFcoseLayout = {
name: 'fcose',
animate: false,
quality: 'proof',
randomize: false,
animate: false,
nodeSeparation: 150,
idealEdgeLength: 200,
nodeRepulsion: 20000,
padding: 50,
randomize: false,
tile: true,
tilingPaddingVertical: 100,
tilingPaddingHorizontal: 100,
fit: true,
componentSpacing: 100,
edgeElasticity: 0.45,
gravity: 0.75,
initialEnergyOnIncremental: 0.5,
} as FcoseLayoutOptions
}

const layout = cy.layout(layoutOptions)
layout.run()
Expand Down
23 changes: 10 additions & 13 deletions frontend/console/src/features/graph/graph-styles.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Stylesheet } from 'cytoscape'
import type { StylesheetCSS } from 'cytoscape'
import colors from 'tailwindcss/colors'

export const createGraphStyles = (isDarkMode: boolean): Stylesheet[] => {
export const createGraphStyles = (isDarkMode: boolean): StylesheetCSS[] => {
const theme = {
primary: isDarkMode ? colors.indigo[400] : colors.indigo[200],
background: isDarkMode ? colors.slate[700] : colors.slate[200],
Expand All @@ -17,7 +17,7 @@ export const createGraphStyles = (isDarkMode: boolean): Stylesheet[] => {
return [
{
selector: 'node',
style: {
css: {
'background-color': theme.primary,
label: 'data(label)',
'text-valign': 'center',
Expand All @@ -36,7 +36,7 @@ export const createGraphStyles = (isDarkMode: boolean): Stylesheet[] => {
},
{
selector: 'edge',
style: {
css: {
width: 2,
'line-color': theme.arrow,
'curve-style': 'bezier',
Expand All @@ -47,19 +47,16 @@ export const createGraphStyles = (isDarkMode: boolean): Stylesheet[] => {
},
{
selector: '$node > node',
style: {
'padding-top': '10px',
'padding-left': '10px',
'padding-bottom': '10px',
'padding-right': '10px',
css: {
padding: '10px',
'text-valign': 'top',
'text-halign': 'center',
'background-color': theme.background,
},
},
{
selector: 'node[type="groupNode"]',
style: {
css: {
'background-color': theme.primary,
shape: 'round-rectangle',
width: '180px',
Expand All @@ -76,23 +73,23 @@ export const createGraphStyles = (isDarkMode: boolean): Stylesheet[] => {
},
{
selector: ':parent',
style: {
css: {
'text-valign': 'top',
'text-halign': 'center',
'background-opacity': 1,
},
},
{
selector: '.selected',
style: {
css: {
'background-color': theme.selected.bg,
'border-width': 2,
'border-color': theme.selected.border,
},
},
{
selector: 'node[type="node"]',
style: {
css: {
'background-color': 'data(backgroundColor)',
color: theme.text,
shape: 'round-rectangle',
Expand Down
Loading
Loading