@geode/opengeodeweb-front 10.34.0-rc.11 → 10.34.0-rc.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/components/csv-preview/CsvPreviewer.vue +21 -22
- package/app/stores/app.ts +2 -0
- package/app/stores/viewer.ts +1 -0
- package/internal/stores/hybrid_viewer/camera.ts +12 -4
- package/internal/stores/hybrid_viewer/filters.ts +3 -9
- package/internal/stores/hybrid_viewer/viewport.ts +4 -10
- package/package.json +1 -1
|
@@ -77,34 +77,33 @@ function autoDetectSeparator(content: string): string {
|
|
|
77
77
|
return best;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
function splitLine(line: string): string[] {
|
|
81
|
+
if (!separator.value) {
|
|
82
|
+
return [line];
|
|
83
|
+
}
|
|
84
|
+
const result = [];
|
|
85
|
+
let current = "";
|
|
86
|
+
let inQuotes = false;
|
|
87
|
+
for (const char of line) {
|
|
88
|
+
if (char === '"') {
|
|
89
|
+
inQuotes = !inQuotes;
|
|
90
|
+
} else if (char === separator.value && !inQuotes) {
|
|
91
|
+
result.push(current.trim());
|
|
92
|
+
current = "";
|
|
93
|
+
} else {
|
|
94
|
+
current += char;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
result.push(current.trim());
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
|
|
80
101
|
function parseContent(): string[] {
|
|
81
102
|
if (!rawContent.value) {
|
|
82
103
|
return [];
|
|
83
104
|
}
|
|
84
105
|
|
|
85
106
|
const allLines = rawContent.value.split(/\r?\n/u).filter((line) => line.trim() !== "");
|
|
86
|
-
|
|
87
|
-
function splitLine(line: string): string[] {
|
|
88
|
-
if (!separator.value) {
|
|
89
|
-
return [line];
|
|
90
|
-
}
|
|
91
|
-
const result = [];
|
|
92
|
-
let current = "";
|
|
93
|
-
let inQuotes = false;
|
|
94
|
-
for (const char of line) {
|
|
95
|
-
if (char === '"') {
|
|
96
|
-
inQuotes = !inQuotes;
|
|
97
|
-
} else if (char === separator.value && !inQuotes) {
|
|
98
|
-
result.push(current.trim());
|
|
99
|
-
current = "";
|
|
100
|
-
} else {
|
|
101
|
-
current += char;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
result.push(current.trim());
|
|
105
|
-
return result;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
107
|
const headerLine = allLines[headerRow.value];
|
|
109
108
|
const rawHeaders = headerLine ? splitLine(headerLine) : [];
|
|
110
109
|
|
package/app/stores/app.ts
CHANGED
|
@@ -142,6 +142,7 @@ export const useAppStore = defineStore("app", () => {
|
|
|
142
142
|
getExtensionEnabled,
|
|
143
143
|
} = useAppExtensions();
|
|
144
144
|
|
|
145
|
+
// oxlint-disable-next-line unicorn/consistent-function-scoping
|
|
145
146
|
async function upload(file: Readonly<File>, callbacks: RequestHandlers = {}): Promise<unknown> {
|
|
146
147
|
const store = useAppStore();
|
|
147
148
|
const schema = opengeodeweb_front_schemas.api.local.extensions.upload;
|
|
@@ -163,6 +164,7 @@ export const useAppStore = defineStore("app", () => {
|
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
// `TResult` is asserted, not verified, at the single `return result as TResult` boundary below: the backend response is only checked against `schema` at runtime, so callers' `TResult` is a contract with the schema, not something this function can prove.
|
|
167
|
+
// oxlint-disable-next-line unicorn/consistent-function-scoping
|
|
166
168
|
async function request<TResult = unknown>(
|
|
167
169
|
{
|
|
168
170
|
schema,
|
package/app/stores/viewer.ts
CHANGED
|
@@ -110,13 +110,21 @@ function centerCameraOnPosition(
|
|
|
110
110
|
if (!camera || !pickedPosition) {
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
|
-
const focalPoint = camera.getFocalPoint();
|
|
114
113
|
const position = camera.getPosition();
|
|
114
|
+
const directionOfProjection = camera.getDirectionOfProjection();
|
|
115
|
+
const distance = dot(
|
|
116
|
+
[
|
|
117
|
+
pickedPosition[0] - position[0],
|
|
118
|
+
pickedPosition[1] - position[1],
|
|
119
|
+
pickedPosition[2] - position[2],
|
|
120
|
+
],
|
|
121
|
+
directionOfProjection,
|
|
122
|
+
);
|
|
115
123
|
camera.setFocalPoint(...pickedPosition);
|
|
116
124
|
camera.setPosition(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
125
|
+
pickedPosition[0] - distance * directionOfProjection[0],
|
|
126
|
+
pickedPosition[1] - distance * directionOfProjection[1],
|
|
127
|
+
pickedPosition[2] - distance * directionOfProjection[2],
|
|
120
128
|
);
|
|
121
129
|
}
|
|
122
130
|
|
|
@@ -2,7 +2,7 @@ import { useHybridViewerCore } from "./core";
|
|
|
2
2
|
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
3
3
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
|
|
4
4
|
|
|
5
|
-
async function
|
|
5
|
+
async function setClippingPlanes(ids: string[], planes: unknown): Promise<void> {
|
|
6
6
|
const viewerStore = useViewerStore();
|
|
7
7
|
const { remoteRender } = useHybridViewerCore();
|
|
8
8
|
const schema = viewer_schemas.opengeodeweb_viewer.viewer.clipping_planes;
|
|
@@ -16,7 +16,7 @@ async function performSetClippingPlanes(ids: string[], planes: unknown): Promise
|
|
|
16
16
|
});
|
|
17
17
|
await remoteRender();
|
|
18
18
|
}
|
|
19
|
-
async function
|
|
19
|
+
async function setShrink(ids: string[], shrink_factor: number): Promise<void> {
|
|
20
20
|
const viewerStore = useViewerStore();
|
|
21
21
|
const { remoteRender } = useHybridViewerCore();
|
|
22
22
|
const schema = viewer_schemas.opengeodeweb_viewer.viewer.shrink;
|
|
@@ -34,15 +34,9 @@ function useHybridViewerFilters(): {
|
|
|
34
34
|
setClippingPlanes: (ids: string[], planes: unknown) => Promise<void>;
|
|
35
35
|
setShrink: (ids: string[], shrink_factor: number) => Promise<void>;
|
|
36
36
|
} {
|
|
37
|
-
async function setClippingPlanes(ids: string[], planes: unknown): Promise<void> {
|
|
38
|
-
await performSetClippingPlanes(ids, planes);
|
|
39
|
-
}
|
|
40
|
-
async function setShrink(ids: string[], shrink_factor: number): Promise<void> {
|
|
41
|
-
await performSetShrink(ids, shrink_factor);
|
|
42
|
-
}
|
|
43
37
|
return {
|
|
44
38
|
setClippingPlanes,
|
|
45
39
|
setShrink,
|
|
46
40
|
};
|
|
47
41
|
}
|
|
48
|
-
export {
|
|
42
|
+
export { useHybridViewerFilters };
|
|
@@ -15,7 +15,7 @@ interface HybridViewerViewport {
|
|
|
15
15
|
viewStream: Ref<ViewStreamLike | undefined>;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
async function
|
|
18
|
+
async function resize(width: number, height: number): Promise<void> {
|
|
19
19
|
const { genericRenderWindow, remoteRender, status, viewStream } = useHybridViewerCore();
|
|
20
20
|
const viewerStore = useViewerStore();
|
|
21
21
|
if (viewerStore.status !== Status.CONNECTED || status.value !== Status.CREATED) {
|
|
@@ -77,7 +77,7 @@ function performClickPicking(event: MouseEvent, containerElement: HTMLElement):
|
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
function
|
|
80
|
+
function setContainer(container: ContainerRef | undefined): void {
|
|
81
81
|
if (!container || !container.value) {
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
@@ -102,7 +102,7 @@ function performSetContainer(container: ContainerRef | undefined): void {
|
|
|
102
102
|
transition: "opacity 0.1s ease-in",
|
|
103
103
|
zIndex: 1,
|
|
104
104
|
});
|
|
105
|
-
void
|
|
105
|
+
void resize(containerElement.offsetWidth, containerElement.offsetHeight);
|
|
106
106
|
let has_dragged = false;
|
|
107
107
|
useMousePressed({
|
|
108
108
|
target: containerElement,
|
|
@@ -167,17 +167,11 @@ function performSetContainer(container: ContainerRef | undefined): void {
|
|
|
167
167
|
}
|
|
168
168
|
function useHybridViewerViewport(): HybridViewerViewport {
|
|
169
169
|
const { viewStream } = useHybridViewerCore();
|
|
170
|
-
function setContainer(container: ContainerRef | undefined): void {
|
|
171
|
-
performSetContainer(container);
|
|
172
|
-
}
|
|
173
|
-
async function resize(width: number, height: number): Promise<void> {
|
|
174
|
-
await performResize(width, height);
|
|
175
|
-
}
|
|
176
170
|
return {
|
|
177
171
|
setContainer,
|
|
178
172
|
resize,
|
|
179
173
|
viewStream,
|
|
180
174
|
};
|
|
181
175
|
}
|
|
182
|
-
export { performClickPicking,
|
|
176
|
+
export { performClickPicking, useHybridViewerViewport };
|
|
183
177
|
export type { ViewStreamLike } from "./vtk_types";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
-
"version": "10.34.0-rc.
|
|
3
|
+
"version": "10.34.0-rc.12",
|
|
4
4
|
"description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
|
|
5
5
|
"homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
|
|
6
6
|
"bugs": {
|