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

[gui2] Language Server binary protocol, and loading of visualization data #7873

Merged
merged 155 commits into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from 152 commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
f3a4bb2
add vue ide project files
Frizi Aug 29, 2023
e8360d7
rename gui2 folder
Frizi Aug 30, 2023
e3a07dd
cleanup
Frizi Aug 30, 2023
f8d9d91
cleanup
Frizi Aug 30, 2023
8451e79
do not react to keypress when editing text
Frizi Aug 30, 2023
d249222
update codeowners
Frizi Aug 30, 2023
f67fd2f
wip: (broken) begin porting visualizations to vue
somebody1234 Sep 4, 2023
d186dcd
Restore circular menu from other branch; move visualizations to separ…
somebody1234 Sep 5, 2023
f634a66
Use `Visualization` component in visualizations; try to figure out ho…
somebody1234 Sep 5, 2023
64acf2c
Remove scoped styles
somebody1234 Sep 5, 2023
2aba41b
Merge branch 'develop' into wip/sb/gui2-viz-vue-port
somebody1234 Sep 6, 2023
fef0d20
Add fullscreen button; begin fullscreen functionality
somebody1234 Sep 6, 2023
1bcb6d1
Fix fullscreen visualization
somebody1234 Sep 6, 2023
ad8ac66
Add width/height/fullscreen props to all visualizations
somebody1234 Sep 6, 2023
c1f9cd1
Make visualization ref typesafe in `GraphNode`
somebody1234 Sep 6, 2023
6c75b42
Hide visualization by default
somebody1234 Sep 6, 2023
6fb234e
Add `undefined` to width/height prop
somebody1234 Sep 7, 2023
33b5a9e
Transparently pass through props
somebody1234 Sep 7, 2023
5806867
Add `visualizationTypes` ref
somebody1234 Sep 7, 2023
af41845
Implement visualization selector
somebody1234 Sep 7, 2023
d9d2672
Fix caching visualizations
somebody1234 Sep 7, 2023
35717bf
Change how visualizations are registered (tentative)
somebody1234 Sep 7, 2023
2341d9c
Fix some lints
somebody1234 Sep 7, 2023
913b82f
Switch to new visualization format
somebody1234 Sep 7, 2023
bd28a16
Merge branch 'develop' into wip/sb/gui2-viz-vue-port
somebody1234 Sep 7, 2023
028ae80
Visualization store
somebody1234 Sep 7, 2023
022f6b3
Add default value for image visualization
somebody1234 Sep 7, 2023
254e7a4
Move visualization names and input types to script block
somebody1234 Sep 7, 2023
2a32970
Add support for viz style and script depenndencies
somebody1234 Sep 8, 2023
eb144fb
Remove style dependencies
somebody1234 Sep 8, 2023
2da4440
Fix scatterplot visualization
somebody1234 Sep 8, 2023
3ac2780
Begin porting geo map; switch to URL imports
somebody1234 Sep 8, 2023
0d53ab7
Continue porting GeoMap visualization
somebody1234 Sep 8, 2023
a9dbcfe
Merge branch 'develop' into wip/sb/gui2-viz-vue-port
somebody1234 Sep 8, 2023
d671a5c
Add 'Error' and 'JSON' visualizations
somebody1234 Sep 8, 2023
ebe5d66
remove debug code
somebody1234 Sep 8, 2023
58098d2
Fixes for scatterplot visualization
somebody1234 Sep 8, 2023
0c9d110
Move icons to monolithic SVG; minor bug fixes
somebody1234 Sep 8, 2023
f4de204
Dynamically compile visualizations
somebody1234 Sep 9, 2023
aaa4bbb
Fix CSS scoping - template scoping is still broken
somebody1234 Sep 9, 2023
19a7030
Extract viz compiler to Web Worker; fix template scopeId not being added
somebody1234 Sep 9, 2023
e58413b
Implement module cache
somebody1234 Sep 9, 2023
210dac3
Minor tidying up; change one FIXME to TODO
somebody1234 Sep 9, 2023
c52d816
Stricter typechecking
somebody1234 Sep 11, 2023
13041ec
Continue fixing Geo Map
somebody1234 Sep 11, 2023
3ee3b15
Switch from data URLs to object URLs
somebody1234 Sep 11, 2023
0e61f36
Finish porting GeoMap visualization; restore script loading for non-E…
somebody1234 Sep 11, 2023
9014287
Fix `z-index` - mapbox's information button has `z-index: 2`
somebody1234 Sep 11, 2023
6e51911
Add Table visualization
somebody1234 Sep 11, 2023
78ae76c
Add space and shift+space handling for visualizations
somebody1234 Sep 11, 2023
5303d21
Improve table visualization
somebody1234 Sep 11, 2023
97ac48f
Minor fixes to Table Visualization CSS
somebody1234 Sep 11, 2023
8855771
Fix minor style issues
somebody1234 Sep 12, 2023
67142b4
Fix types in Table Visualization
somebody1234 Sep 12, 2023
9117d77
Implement resizing
somebody1234 Sep 12, 2023
abd85c9
Add SQL visualization
somebody1234 Sep 12, 2023
8fb14fd
wip: Add Heatmap Visualization
somebody1234 Sep 12, 2023
feb3523
Add Heatmap visualization; fix points being added multiple times in S…
somebody1234 Sep 12, 2023
f7f5e3e
Fix bugs in Heatmap visualization
somebody1234 Sep 12, 2023
906f771
Fix dropdown
somebody1234 Sep 13, 2023
fccde2c
Default viz width to node width
somebody1234 Sep 13, 2023
57804b6
Properly update `nodeWidth` on resize
somebody1234 Sep 13, 2023
0046744
Change `nodeWidth` to `nodeSize`
somebody1234 Sep 13, 2023
9bd5f83
Merge branch 'develop' into wip/sb/gui2-viz-vue-port
somebody1234 Sep 13, 2023
c6f444a
Hide circular menu by default
somebody1234 Sep 13, 2023
0d4b7d1
Fixes
somebody1234 Sep 13, 2023
053f50e
Fix scatterplot brushing
somebody1234 Sep 13, 2023
01a25b4
Open circular menu on focus
somebody1234 Sep 13, 2023
d09a9b4
Fix cursor when dragging
somebody1234 Sep 13, 2023
2c3130b
prettier
somebody1234 Sep 13, 2023
4c81b43
integrate dashboard to new gui
Frizi Sep 11, 2023
fd5bd39
gateway server module code and metadata loading
Frizi Sep 14, 2023
1f65891
use vite directly for building dashboard in gui2
Frizi Sep 14, 2023
f18cd01
fix comment
Frizi Sep 14, 2023
06e60dd
Add binary protocol reader and writer
somebody1234 Sep 14, 2023
3d4f239
WIP: Add bare-bones impleemntation of binary WebSocket
somebody1234 Sep 14, 2023
a172908
wip
somebody1234 Sep 15, 2023
94f3820
Add more LS endpoints
somebody1234 Sep 15, 2023
4586170
Add viz update handler
somebody1234 Sep 15, 2023
445636c
Merge branch 'wip/sb/gui2-viz-vue-port' into wip/sb/connect-viz
somebody1234 Sep 15, 2023
91d3578
fix bug
somebody1234 Sep 15, 2023
82ac1b9
Try to get data server working
somebody1234 Sep 15, 2023
ff76e12
prettier
somebody1234 Sep 15, 2023
7991f9a
Continue trying to get visualizations to work
somebody1234 Sep 15, 2023
dba316f
Switch from `Emitter` to `ObservableV2`
somebody1234 Sep 15, 2023
b897d53
wip: More execution context initialization
somebody1234 Sep 15, 2023
ce69d4b
Partially address review
somebody1234 Sep 15, 2023
34f80bc
Use `ToggleIcon` in `CircularMenu`
somebody1234 Sep 15, 2023
d8bb879
Move `VisualizationContainer` back to `src/`
somebody1234 Sep 15, 2023
63f2ce6
Supply visualization config by `provide` instead of props
somebody1234 Sep 15, 2023
7e8e41d
Firefox scrollbar styling
somebody1234 Sep 15, 2023
53d5428
Initial implementation of histogram visualization; reorder builtin vi…
somebody1234 Sep 18, 2023
c51e9c4
Fix histogram visualization
somebody1234 Sep 18, 2023
06ef295
Switch from `.enter`/`.exit` to `.join`
somebody1234 Sep 18, 2023
a5e7ba6
Fix autosizing in Table visualization
somebody1234 Sep 18, 2023
c1a1883
wip: Histogram fixes
somebody1234 Sep 19, 2023
95dca11
Fix scatterplot axis labels
somebody1234 Sep 19, 2023
92380a2
Remove null checks for D3
somebody1234 Sep 19, 2023
6c83f22
Begin implementing D3 feedback
somebody1234 Sep 19, 2023
5f6337b
Simplify `useEvent` and use it
somebody1234 Sep 19, 2023
a4492ff
Continue implementing D3 feedback
somebody1234 Sep 19, 2023
3a30aef
Continue implementing D3 feedback
somebody1234 Sep 19, 2023
23d2b61
fixes
somebody1234 Sep 19, 2023
973166d
more fixes
somebody1234 Sep 19, 2023
e002456
Replace `d3Types` with `import type {}`
somebody1234 Sep 19, 2023
d8e279b
Fix zooming not working in Histogram
somebody1234 Sep 19, 2023
9805c6e
wip: Fix scatterplot
somebody1234 Sep 19, 2023
4e464ad
Fix scatterplot
somebody1234 Sep 19, 2023
82237cd
Refactor Heatmap visualization
somebody1234 Sep 19, 2023
05ad70a
Merge branch 'wip/sb/gui2-viz-vue-port' into wip/sb/connect-viz
somebody1234 Sep 20, 2023
0f4f2de
Fix binary protocol; attempt to get visualizations working
somebody1234 Sep 20, 2023
b836159
Add `text/` endpoints to LS API wrapper
somebody1234 Sep 20, 2023
458c0ce
Add `vcs/` endpoints to LS API wrapper
somebody1234 Sep 20, 2023
0cbd55a
Make websocket calls match old GUI
somebody1234 Sep 20, 2023
08b7a1c
prettier
somebody1234 Sep 20, 2023
4f411d2
Add Language Server error codes
somebody1234 Sep 21, 2023
d794df2
Fix casing of enum members
somebody1234 Sep 21, 2023
cb57d31
Finally fix visualization data retrieval
somebody1234 Sep 21, 2023
f8bb1ac
Address review
somebody1234 Sep 22, 2023
02c2054
Add docs for visualization compiler
somebody1234 Sep 22, 2023
a968003
Integrate icons for builtin viz into `icons.svg`
somebody1234 Sep 22, 2023
856e05c
Merge branch 'develop' into wip/sb/gui2-viz-vue-port
somebody1234 Sep 22, 2023
e88c664
Merge branch 'wip/sb/gui2-viz-vue-port' into wip/sb/connect-viz
somebody1234 Sep 22, 2023
ab1da07
Fix type errors
somebody1234 Sep 22, 2023
80b3544
Fix bugs
somebody1234 Sep 22, 2023
aa9a452
prettier
somebody1234 Sep 22, 2023
2e1b180
Add license for websocket module
somebody1234 Sep 22, 2023
26eefd0
Remove spurious changes
somebody1234 Sep 22, 2023
40fdfee
prettier
somebody1234 Sep 22, 2023
dd533d8
Merge branch 'wip/sb/gui2-viz-vue-port' into wip/sb/connect-viz
somebody1234 Sep 22, 2023
dc49b5b
Remove `expressionUpdates` listener from gui
somebody1234 Sep 22, 2023
d38c902
Attempt to fix ci
somebody1234 Sep 22, 2023
57b927c
Merge branch 'develop' into wip/sb/connect-viz
somebody1234 Sep 26, 2023
3f51108
Fixes
somebody1234 Sep 27, 2023
483c43c
Address minor review issues
somebody1234 Sep 27, 2023
d9b8616
Refactor visualization updates into project store
somebody1234 Sep 27, 2023
b96fb71
Merge branch 'develop' into wip/sb/connect-viz
somebody1234 Sep 28, 2023
73dc001
Fix bugs?
somebody1234 Sep 28, 2023
3a8dd5b
Refactor execution context into project store
somebody1234 Sep 28, 2023
46c32c9
Revert changes to ide-desktop
somebody1234 Sep 29, 2023
77ebb1a
Merge branch 'develop' into wip/sb/connect-viz
somebody1234 Oct 2, 2023
a5b8919
Fixes
somebody1234 Oct 2, 2023
bdce01f
Fix?
somebody1234 Oct 2, 2023
f2ed300
Fix visualization selector not closing
somebody1234 Oct 2, 2023
6867221
Merge branch 'develop' into wip/sb/connect-viz
somebody1234 Oct 2, 2023
9ddc60d
Merge remote-tracking branch 'origin/develop' into wip/sb/connect-viz
farmaazon Oct 2, 2023
217765c
Fix changing visualization type
somebody1234 Oct 2, 2023
525dca2
Merge branch 'develop' into wip/sb/connect-viz
Frizi Oct 4, 2023
b8af478
More robust execution context.
Frizi Oct 4, 2023
f0e27b4
visualizations in node metadata
Frizi Oct 6, 2023
6ea1e82
fix node-height
Frizi Oct 6, 2023
2497ed9
fix loading visualization name
Frizi Oct 6, 2023
1831216
add net util tests
Frizi Oct 6, 2023
a8adbd2
remove `pushCall` from execution context public API.
Frizi Oct 6, 2023
910133d
fix gui2 build, nicer code editor styling
Frizi Oct 7, 2023
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
1 change: 1 addition & 0 deletions app/gui2/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ coverage

# Editor directories and files
.vscode/*
!.vscode/settings.json
!.vscode/extensions.json
.idea
*.suo
Expand Down
3 changes: 3 additions & 0 deletions app/gui2/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"prettier.prettierPath": "../../node_modules/prettier/index.cjs"
}
1 change: 0 additions & 1 deletion app/gui2/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ declare module 'builtins' {
export const VisualizationContainer: typeof import('@/components/VisualizationContainer.vue').default
export const useVisualizationConfig: typeof import('@/providers/visualizationConfig').useVisualizationConfig
export const defineKeybinds: typeof import('@/util/shortcuts').defineKeybinds
export const d3: typeof import('d3')
}
1 change: 1 addition & 0 deletions app/gui2/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const conf = [
rules: {
camelcase: [1, { ignoreImports: true }],
'no-inner-declarations': 0,
'vue/attribute-hyphenation': [2, 'never'],
'vue/v-on-event-hyphenation': [2, 'never'],
'@typescript-eslint/no-unused-vars': [
1,
Expand Down
2 changes: 1 addition & 1 deletion app/gui2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"fast-diff": "^1.3.0",
"hash-sum": "^2.0.0",
"isomorphic-ws": "^5.0.0",
"lib0": "^0.2.83",
"lib0": "^0.2.85",
"magic-string": "^0.30.3",
"murmurhash": "^2.0.1",
"pinia": "^2.1.6",
Expand Down
52 changes: 27 additions & 25 deletions app/gui2/public/visualizations/ScatterplotVisualization.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ import { defineKeybinds } from 'builtins'

export const name = 'Scatterplot'
export const inputType = 'Standard.Table.Data.Table.Table | Standard.Base.Data.Vector.Vector'
const DEFAULT_LIMIT = 1024
export const defaultPreprocessor = [
'Standard.Visualization.Scatter_Plot',
'process_to_json_text',
'Nothing',
DEFAULT_LIMIT.toString(),
]

const bindings = defineKeybinds('scatterplot-visualization', {
zoomIn: ['Mod+Z'],
Expand Down Expand Up @@ -68,7 +75,7 @@ enum ScaleType {

interface AxisConfiguration {
label: string
scale: ScaleType
scale?: ScaleType
}

interface AxesConfiguration {
Expand All @@ -84,8 +91,10 @@ interface Color {
</script>

<script setup lang="ts">
import { d3 } from 'builtins'
import { computed, onMounted, ref, watch, watchEffect, watchPostEffect } from 'vue'
import { computed, ref, watch, watchEffect, watchPostEffect } from 'vue'

import * as d3 from 'd3'

import FindIcon from './icons/find.svg'
import ShowAllIcon from './icons/show_all.svg'

Expand All @@ -106,12 +115,9 @@ const POINT_LABEL_PADDING_X_PX = 7
const POINT_LABEL_PADDING_Y_PX = 2
const ANIMATION_DURATION_MS = 400
const VISIBLE_POINTS = 'visible'
const DEFAULT_LIMIT = 1024
const ACCENT_COLOR: Color = { red: 78, green: 165, blue: 253 }
const SIZE_SCALE_MULTIPLER = 100
const FILL_COLOR = `rgba(${ACCENT_COLOR.red * 255},${ACCENT_COLOR.green * 255},${
ACCENT_COLOR.blue * 255
},0.8)`
const FILL_COLOR = `rgba(${ACCENT_COLOR.red},${ACCENT_COLOR.green},${ACCENT_COLOR.blue},0.8)`

const ZOOM_EXTENT = [0.5, 20] satisfies d3.BrushSelection
const RIGHT_BUTTON = 2
Expand Down Expand Up @@ -201,18 +207,18 @@ const margin = computed(() => {
return { top: 10, right: 10, bottom: 35, left: 55 }
}
})
const width = ref(Math.max(config.value.width ?? 0, config.value.nodeSize.x))
watchPostEffect(() => {
width.value = config.value.fullscreen
const width = computed(() =>
config.value.fullscreen
? containerNode.value?.parentElement?.clientWidth ?? 0
: Math.max(config.value.width ?? 0, config.value.nodeSize.x)
})
const height = ref(config.value.height ?? (config.value.nodeSize.x * 3) / 4)
watchPostEffect(() => {
height.value = config.value.fullscreen
: Math.max(config.value.width ?? 0, config.value.nodeSize.x),
)

const height = computed(() =>
config.value.fullscreen
? containerNode.value?.parentElement?.clientHeight ?? 0
: config.value.height ?? (config.value.nodeSize.x * 3) / 4
})
: config.value.height ?? (config.value.nodeSize.x * 3) / 4,
)

const boxWidth = computed(() => Math.max(0, width.value - margin.value.left - margin.value.right))
const boxHeight = computed(() => Math.max(0, height.value - margin.value.top - margin.value.bottom))
const xTicks = computed(() => boxWidth.value / 40)
Expand All @@ -229,17 +235,15 @@ const yLabelLeft = computed(
)
const yLabelTop = computed(() => -margin.value.left + 15)

function updatePreprocessor() {
watchEffect(() => {
emit(
'update:preprocessor',
'Standard.Visualization.Scatter_Plot',
'process_to_json_text',
bounds.value == null ? 'Nothing' : '[' + bounds.value.join(',') + ']',
limit.value.toString(),
)
}

onMounted(updatePreprocessor)
})

watchEffect(() => (focus.value = data.value.focus))

Expand Down Expand Up @@ -409,7 +413,6 @@ function zoomToSelected() {
const yMin = yScale_.invert(yMinRaw)
const yMax = yScale_.invert(yMaxRaw)
bounds.value = [xMin, yMin, xMax, yMax]
updatePreprocessor()
xDomain.value = [xMin, xMax]
yDomain.value = [yMin, yMax]
}
Expand All @@ -435,7 +438,7 @@ function matchShape(d: Point) {
* @param axis Axis information as received in the visualization update.
* @returns D3 scale. */
function axisD3Scale(axis: AxisConfiguration | undefined) {
return axis != null ? SCALE_TO_D3_SCALE[axis.scale]() : d3.scaleLinear()
return axis?.scale != null ? SCALE_TO_D3_SCALE[axis.scale]() : d3.scaleLinear()
}

watchEffect(() => {
Expand Down Expand Up @@ -522,7 +525,6 @@ function showAll() {
extremesAndDeltas.value.yMin - extremesAndDeltas.value.paddingY,
extremesAndDeltas.value.yMax + extremesAndDeltas.value.paddingY,
]
updatePreprocessor()
endBrushing()
}

Expand All @@ -539,7 +541,7 @@ useEvent(document, 'scroll', endBrushing)
</script>

<template>
<VisualizationContainer :below-toolbar="true">
<VisualizationContainer :belowToolbar="true">
<template #toolbar>
<button class="image-button active">
<img :src="ShowAllIcon" alt="Fit all" @pointerdown="showAll" />
Expand Down
6 changes: 6 additions & 0 deletions app/gui2/public/visualizations/template.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<script lang="ts">
export const name = '<name here>'
export const inputType = '<allowed input type(s) here>'
// Optional:
export const defaultPreprocessor = [
'<module path here>',
'<method name here>',
'<optional args here>',
]

interface Data {
dataType: 'here'
Expand Down
Loading
Loading