summaryrefslogtreecommitdiff
path: root/components/config.ts
blob: c6f581dc86269981ffcd9dcc6508093936fa1606 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import { Easing } from '@tweenjs/tween.js'
const options: string[] = []
const algorithms: { [name: string]: (percent: number) => number } = {}
for (let type in Easing) {
  for (let mode in (Easing as any)[type]) {
    let name = type + mode
    if (name === 'LinearNone') {
      name = 'Linear'
    }
    options.push(name)
    algorithms[name] = (Easing as any)[type][mode]
  }
}

export const initialPhysics = {
  enabled: true,
  charge: -350,
  collision: true,
  collisionStrength: 20,
  centering: true,
  centeringStrength: 0.05,
  linkStrength: 0.1,
  linkIts: 1,
  particles: false,
  particlesNumber: 0,
  particlesWidth: 4,
  linkOpacity: 0.7,
  linkWidth: 1,
  nodeRel: 4,
  nodeOpacity: 0.9,
  nodeResolution: 8,
  labels: 2,
  labelScale: 1.5,
  alphaDecay: 0.02,
  alphaTarget: 0,
  alphaMin: 0,
  velocityDecay: 0.25,
  gravity: 0.5,
  gravityOn: true,
  colorful: true,
  galaxy: true,
  ticks: 1,
  hover: 'highlight',
  click: 'select',
  doubleClick: 'local',
  iterations: 0,
  highlight: true,
  highlightNodeSize: 2,
  highlightLinkSize: 2,
  highlightAnim: false,
  animationSpeed: 250,
  algorithms: algorithms,
  algorithmOptions: options,
  algorithmName: 'CubicOut',
  orphans: false,
  follow: 'Local',
}

export const initialFilter = {
  orphans: false,
  parents: true,
  tags: [],
  nodes: [],
  links: [],
  date: [],
}

export const initialVisuals = {
  particles: false,
  particlesNumber: 0,
  particlesWidth: 4,
  linkOpacity: 0.7,
  linkWidth: 1,
  nodeRel: 4,
  nodeOpacity: 0.9,
  nodeResolution: 8,
  labels: 2,
  labelScale: 1.5,
  highlight: true,
  highlightNodeSize: 2,
  highlightLinkSize: 2,
  highlightAnim: false,
  animationSpeed: 250,
  algorithms: algorithms,
  algorithmOptions: options,
  algorithmName: 'CubicOut',
  linkColorScheme: 'grey',
  nodeColorScheme: ['gray', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'pink', 'purple'],
  nodeHighlight: '',
  linkHighlight: '',
}

export type Visuals = {
  particles: boolean
  particlesNumber: number
  particlesWidth: number
  linkOpacity: number
  linkWidth: number
  nodeRel: number
  nodeOpacity: number
  nodeResolution: number
  labels: number
  labelScale: number
  highlight: boolean
  highlightNodeSize: number
  highlightLinkSize: number
  highlightAnim: boolean
  animationSpeed: number
  algorithms: typeof algorithms
  algorithmOptions: typeof options
  algorithmName: string
  linkColorScheme: string
  nodeColorScheme: string[]
  nodeHighlight: string
  linkHighlight: string
}