Skip to content

Commit 2f07904

Browse files
authored
Merge pull request #20 from MetacityTools/dev
Releasing 0.5.0
2 parents ce984f0 + aa59686 commit 2f07904

117 files changed

Lines changed: 2668 additions & 2183 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,24 @@ jobs:
6868
cd Studio
6969
npm i
7070
npm run build
71+
72+
dev-release:
73+
runs-on: ubuntu-latest
74+
if: github.event_name == 'push' && contains(github.ref, 'dev')
75+
needs: build
76+
steps:
77+
- uses: actions/checkout@v3
78+
- name: Deploying to server
79+
uses: appleboy/ssh-action@v0.1.10
80+
with:
81+
host: ${{ secrets.SERVER_HOST }}
82+
username: ${{ secrets.SERVER_USERNAME }}
83+
key: ${{ secrets.SERVER_SSH_KEY }}
84+
port: ${{ secrets.PORT }}
85+
script: |
86+
cd dev
87+
rm -rf Studio
88+
GIT_SSH_COMMAND="ssh -i ~/.ssh/github" git clone -b dev git@github.com:MetacityTools/Studio.git
89+
cd Studio
90+
npm i
91+
npm run build

README.md

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,7 @@ These features are planned for the future, but not yet scheduled.
3434

3535
### Priority Backlog
3636

37-
- [ ] Filter file inputs (add format filters)
38-
- [ ] Click off model - deselect all
39-
- [ ] Color indicating in group vs out of group in viewer
40-
- [ ] Delete group action button in the hierarchy menu
41-
- [ ] Group selection in hierarchy tree optimization (shift to select, deselect previous on selectiong previous)
42-
- [ ] Open editor on Group select
43-
- [ ] Unselect all on clicking away
4437
- [ ] Shortcuts for tab switching in editor
45-
- [ ] When in Table view, click to select model and extend the selection based on groups on key/button/action
4638

4739
### Backlog
4840

@@ -53,13 +45,9 @@ These features are planned for the future, but not yet scheduled.
5345
- [ ] Extract Utils to separate SDK form metacity editors
5446
- [ ] Optional interactivity - build BVH only if user opts-in to make the loaded models clickable
5547
- [ ] Optimize deleting models - partition model BVH nodes based on submodels's ids
56-
- [ ] Named groups in hierarchy
5748
- [ ] Insert textured plane (location blueprints for reference)
5849
- [ ] Refactor General context - setting status messages, etc.
5950
- [ ] Add a button to open/hide the side panel
60-
61-
### Bugs and Validations
62-
6351
- [ ] Do not allow keys to be empty in table view during conversion
6452

6553
---
@@ -68,18 +56,51 @@ These features are planned for the future, but not yet scheduled.
6856

6957
These features are planned for the future, and scheduled for a specific release.
7058

71-
### v0.4.1
59+
### v0.5.1
7260

7361
- [ ] Projecting models onto models (2D onto 3D) - ✨WIP https://github.com/vojtatom/geometry
7462
- [ ] Loading points and lines from SHP
7563
- [ ] Export screenshot action
76-
- [ ] Selecting colormap
77-
- [ ] Hierarchy UI controls
78-
79-
🧠 Call for consultation (TB planned, beginning of July 2023)
64+
- [ ] Tooltip on hover over model
65+
- [ ] Dark mode
66+
67+
### v0.5.0 - Work in progress
68+
69+
⚠️ Breaking changes, old `.metacity` files will not be compatible.
70+
🧠 Call for consultation (TB planned, end of July 2023)
71+
72+
- [x] Remove groups and hierarchy - all models will be in a flat list
73+
- [x] Metadata editor replacing Hierarchy editor
74+
- [x] Diffing metadata between models
75+
- [x] Edit metadata on selection
76+
- [x] Editor part 1 - allow editing common attributes
77+
- ~~[ ] Editor part 2 - show which attributes are different (can be overwritten and changed to common)~~ - will not implement for now
78+
- [x] fulltext search filtering - values only
79+
- [x] Styling
80+
- [x] Style Editor
81+
- [x] Auto generate/update styles
82+
- [x] Style outline
83+
- [x] Apply styles to the geometry
84+
- [x] Styling UI - show data infographics
85+
- [x] Clean syling button - switches on tab close
86+
- [x] Updated metadata format - binary buffers + attributes + styling
87+
- [x] Metadata export/import
88+
- [x] Styles
89+
- [x] Updated viewer to sync with studio
90+
- [x] Filter file inputs (add format filters)
91+
- [x] Click off model - deselect all
92+
- [x] Group selection in hierarchy tree optimization (shift to select, deselect previous on selectiong previous)
93+
- [x] When in Table view, click to select model and extend the selection based on groups on key/button/action
94+
- [x] Import and export data separated into models (do not join on export)
95+
- [x] Allow renaming models
96+
- [x] Refactor colors
97+
- [x] Resolve rejects during loading
98+
- [x] Allow colormap codes in styles instead of lists of colors [plasma, viridis, inferno, magma]
8099

81100
### v0.4.0 - ✅ Released
82101

102+
🧠 Call for consultation (TB planned, beginning of July 2023)
103+
83104
- [x] Browsing metadata hierarchy in viewer
84105
- [x] Restructure menu in Editor (unify UI with viewer)
85106
- [x] Remove metadata view from transform view

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "metacity-studio",
33
"private": true,
4-
"version": "0.4.0",
4+
"version": "0.5.0",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

studio/src/assets/index.css

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
html,
66
body,
77
#root {
8-
@apply w-full h-full;
8+
@apply h-full w-full;
99
overscroll-behavior-x: none;
1010
}
1111

@@ -51,23 +51,54 @@ body,
5151
}
5252

5353
input[type='range'] {
54-
@apply appearance-none bg-transparent cursor-pointer outline-none;
54+
@apply cursor-pointer appearance-none bg-transparent outline-none;
5555
}
5656

5757
input[type='range']::-webkit-slider-runnable-track {
58-
@apply bg-neutral-300 rounded-full;
58+
@apply rounded-full bg-neutral-300;
5959
}
6060

6161
input[type='range']::-webkit-slider-thumb {
62-
@apply appearance-none bg-neutral-500 rounded-full w-4 h-4;
62+
@apply h-4 w-4 appearance-none rounded-full bg-neutral-500;
6363
}
6464

6565
input[type='range']::-moz-range-track {
66-
@apply bg-neutral-300 rounded-full;
66+
@apply rounded-full bg-neutral-300;
6767
}
6868

6969
input[type='range']::-ms-track {
70-
@apply bg-neutral-300 rounded-full;
70+
@apply rounded-full bg-neutral-300;
71+
}
72+
73+
select {
74+
@apply cursor-pointer appearance-none bg-transparent outline-none;
75+
}
76+
77+
select::-ms-expand {
78+
display: none;
79+
}
80+
81+
select::-moz-focusring {
82+
color: transparent;
83+
text-shadow: 0 0 0 #000;
84+
}
85+
86+
select::-moz-focus-inner {
87+
border: 0;
88+
}
89+
90+
select option {
91+
@apply bg-white;
92+
}
93+
94+
/* add chevron to select */
95+
96+
select {
97+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="20" fill="none" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 9l4 4 4-4"/></svg>');
98+
background-repeat: no-repeat;
99+
background-position: right 0.5rem center;
100+
background-size: 1rem 1rem;
101+
padding-right: 1.5rem;
71102
}
72103

73104
.shadow-even {

studio/src/bananagl/picking/triangles/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Attribute } from '@bananagl/bananagl';
22

33
import { BVHNode } from '../bvh';
4-
import BuilderWorker from './build.worker?worker&inline';
4+
import BuilderWorker from './build.worker?worker';
55
import {
66
BuilderOutput,
77
fromTransferable,

studio/src/components/Editor/Canvas/Help.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { TbHelp, TbHelpOff } from 'react-icons/tb';
55
import { colorBase } from '@elements/Colors';
66
import { MouseLeft, MouseRight, MouseWheel } from '@elements/Icons';
77

8+
import { useGrayscale } from '@shared/Context/hooks';
9+
810
function HelpItem(props: { children: React.ReactNode; last?: boolean }) {
911
return (
1012
<div className={clsx('flex flex-col pr-2', !props.last && ' border-r')}>
@@ -15,13 +17,15 @@ function HelpItem(props: { children: React.ReactNode; last?: boolean }) {
1517

1618
export function Help() {
1719
const [show, setShow] = React.useState(false);
20+
const [grayscale] = useGrayscale();
1821

1922
if (!show)
2023
return (
2124
<div
2225
className={clsx(
2326
'absolute bottom-4 left-4 bg-white text-md py-2 px-4 rounded-md flex flex-row space-x-4 text-xl cursor-pointer border',
24-
colorBase
27+
colorBase,
28+
grayscale && 'filter grayscale'
2529
)}
2630
onClick={() => setShow(true)}
2731
>

studio/src/components/Editor/Editor.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { SizeGuard } from '@elements/SizeGuard';
66

77
import { CanvasComponent } from '@shared/CanvasComponent';
88
import { Controls } from '@shared/Controls';
9-
import { StyleDetailPanel } from '@shared/StyleDetail';
109

1110
import { Help } from './Canvas/Help';
1211
import { EditorSpash } from './EditorSplash';
@@ -17,19 +16,14 @@ export function ModelEditor() {
1716
<SizeGuard minWidth={600} minHeight={400}>
1817
<div className="w-full h-full">
1918
<Allotment separator={false}>
19+
<Allotment.Pane preferredSize={500} className="border-r border-neutral-200">
20+
<SidePanel />
21+
</Allotment.Pane>
2022
<Allotment.Pane minSize={200} className="bg-neutral-100">
2123
<CanvasComponent />
2224
<Help />
23-
<StyleDetailPanel className="absolute right-0 bottom-0 m-4" />
2425
<Controls />
2526
</Allotment.Pane>
26-
<Allotment.Pane
27-
minSize={500}
28-
preferredSize={500}
29-
className="border-l border-neutral-200"
30-
>
31-
<SidePanel />
32-
</Allotment.Pane>
3327
</Allotment>
3428
</div>
3529
<ProcessingScreen />

studio/src/components/Editor/EditorContext.tsx

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
import React from 'react';
22

3-
import { GroupNode, Node, Tables } from '@utils/utils';
4-
5-
import { useGraph } from '@shared/Context/hooks';
3+
import { Tables } from '@utils/utils';
64

75
interface EditorContextProps {
8-
nodeToMove: Node | undefined;
9-
setNodeToMove: React.Dispatch<React.SetStateAction<Node | undefined>>;
10-
nodeToEdit: Node | undefined;
11-
setNodeToEdit: React.Dispatch<React.SetStateAction<Node | undefined>>;
126
tables: Tables;
137
setTables: React.Dispatch<React.SetStateAction<Tables>>;
148
activeSheet: number;
@@ -20,19 +14,13 @@ interface EditorContextProps {
2014
const context = React.createContext<EditorContextProps>({} as EditorContextProps);
2115

2216
export function EditorContext(props: { children: React.ReactNode }) {
23-
const [nodeToMove, setNodeToMove] = React.useState<Node | undefined>();
24-
const [nodeToEdit, setNodeToEdit] = React.useState<Node | undefined>();
2517
const [tables, setTables] = React.useState<Tables>(new Tables([]));
2618
const [activeSheet, setActiveSheet] = React.useState<number>(0);
2719
const [status, setStatus] = React.useState<'editing' | 'saved' | 'failed' | undefined>();
2820

2921
return (
3022
<context.Provider
3123
value={{
32-
nodeToMove,
33-
setNodeToMove,
34-
nodeToEdit,
35-
setNodeToEdit,
3624
tables,
3725
setTables,
3826
activeSheet,
@@ -50,47 +38,6 @@ export function useTablesContext(): EditorContextProps {
5038
return React.useContext(context);
5139
}
5240

53-
export function useMovingNode(): [Node | undefined, (node: Node | undefined) => void] {
54-
const ctx = React.useContext(context);
55-
const [graph] = useGraph();
56-
57-
const updateNodeToMove = (node: Node | undefined) => {
58-
ctx.setNodeToMove((prev) => {
59-
if (prev === node) return undefined;
60-
if (prev === undefined) return node;
61-
if (node === undefined) return undefined;
62-
else {
63-
if (node instanceof GroupNode) {
64-
if (node.isDescendantOf(prev)) return undefined;
65-
graph.moveNode(prev, node);
66-
return undefined;
67-
} else {
68-
//fallback
69-
return node;
70-
}
71-
}
72-
});
73-
};
74-
75-
return [ctx.nodeToMove, updateNodeToMove];
76-
}
77-
78-
export function useEditingNode(): [Node | undefined, (node: Node | undefined) => void] {
79-
const ctx = React.useContext(context);
80-
81-
const updateNodeToLink = (node: Node | undefined) => {
82-
ctx.setNodeToEdit((prev) => {
83-
if (prev === node || node === undefined) {
84-
return undefined;
85-
} else {
86-
return node;
87-
}
88-
});
89-
};
90-
91-
return [ctx.nodeToEdit, updateNodeToLink];
92-
}
93-
9441
export function useTables(): [Tables, React.Dispatch<React.SetStateAction<Tables>>] {
9542
const ctx = React.useContext(context);
9643
return [ctx.tables, ctx.setTables];

studio/src/components/Editor/SidePanel/Groups/GroupHierarchy/GroupHierarchy.tsx

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)