Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6140e47
Attribute UI creation
BryonLewis Oct 28, 2020
01105c6
Merge branch 'master' into client/attribute_ui
BryonLewis Nov 16, 2020
c5328fd
Removed old attribute
BryonLewis Nov 16, 2020
cb98743
Some suggestions (#446)
subdavis Nov 17, 2020
34bd34e
Temporary update to test HTML inputs
BryonLewis Nov 18, 2020
622c47b
Merge branch 'master' into client/attribute_ui
BryonLewis Nov 19, 2020
6d2141e
Keyboard shortcuts and focusing for HTML Native Attributes
BryonLewis Nov 19, 2020
dba6e93
composition API for AttributeInput
BryonLewis Nov 20, 2020
06515e5
Refactor to subsection
BryonLewis Nov 20, 2020
ada817f
Merge branch 'master' into client/attribute_ui
BryonLewis Nov 20, 2020
2f9b5b7
Need to get scrolling working for this mode
BryonLewis Nov 20, 2020
5b88e83
Almost got scrolling
BryonLewis Nov 20, 2020
986d486
Fixing scrolling in attributes and scroll to track settings
BryonLewis Nov 23, 2020
9fb192e
Update client/viame-web-common/components/AttributeInput.vue
BryonLewis Nov 24, 2020
6bdc4da
Addressing comments
BryonLewis Nov 24, 2020
548f175
change getTrack
subdavis Dec 1, 2020
8aac8a3
Merge pull request #465 from VIAME/client/attribute_ui_getTrack
subdavis Dec 1, 2020
95769d6
Fixing issues
BryonLewis Dec 1, 2020
d67b8ac
Merge branch 'master' into client/attribute_ui
BryonLewis Dec 1, 2020
4e5cc97
Adressing more of my mistakes
BryonLewis Dec 1, 2020
02e72c7
Merge branch 'master' into client/attribute_ui
BryonLewis Dec 1, 2020
e34709a
Merge branch 'master' into client/attribute_ui
subdavis Dec 2, 2020
34e4770
escape focusing
BryonLewis Dec 3, 2020
a7281be
Merge branch 'master' into client/attribute_ui
BryonLewis Dec 3, 2020
af34b2f
Edit Attributes Updates
BryonLewis Dec 3, 2020
39c9729
mend
BryonLewis Dec 3, 2020
accbd86
Small fix (#476)
subdavis Dec 4, 2020
7f874b7
Merge branch 'master' into client/attribute_ui
subdavis Dec 4, 2020
7814149
datalist updates
BryonLewis Dec 4, 2020
4cdf25e
fixes clicking on open datalist attributes
BryonLewis Dec 4, 2020
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: 12 additions & 0 deletions client/platform/desktop/api/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ async function getAttributes() {
return Promise.resolve([] as Attribute[]);
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function setAttribute({ addNew, data }: {addNew: boolean | undefined; data: Attribute}) {
return Promise.resolve();
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function deleteAttribute(data: Attribute) {
return Promise.resolve([] as Attribute[]);
}

async function getPipelineList(settings: Settings): Promise<Pipelines> {
return ipcRenderer.invoke('get-pipeline-list', settings);
}
Expand Down Expand Up @@ -139,6 +149,8 @@ async function runPipeline(itemId: string, pipeline: string, settings: Settings)
export {
/* Standard common APIs */
getAttributes,
setAttribute,
deleteAttribute,
getPipelineList,
runPipeline,
getTrainingConfigurations,
Expand Down
4 changes: 4 additions & 0 deletions client/platform/web-girder/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { DatasetMeta, provideApi } from 'viame-web-common/apispec';
import { VIAMEDataset } from './store/Dataset';
import {
getAttributes,
setAttribute,
deleteAttribute,
getPipelineList,
runPipeline,
getTrainingConfigurations,
Expand All @@ -32,6 +34,8 @@ export default defineComponent({

provideApi({
getAttributes,
setAttribute,
deleteAttribute,
getPipelineList,
runPipeline,
getTrainingConfigurations,
Expand Down
20 changes: 20 additions & 0 deletions client/platform/web-girder/api/viame.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface ValidationResponse {
message: string;
}


function makeViameFolder({
folderId, name, fps, type,
}: {
Expand Down Expand Up @@ -52,6 +53,23 @@ async function getAttributes(): Promise<Attribute[]> {
const { data } = await girderRest.get('/viame/attribute');
return data as Attribute[];
}
function setAttribute({ addNew, data }:
{addNew: boolean | undefined; data: Attribute}): Promise<Attribute[]> {
if (addNew) {
return girderRest.post('/viame/attribute', data);
}
return girderRest.put(
`/viame/attribute/${data._id}`,
data,
);
}

function deleteAttribute(data: Attribute): Promise<Attribute> {
return girderRest.delete(
`/viame/attribute/${data._id}`,
);
}


async function getPipelineList() {
const { data } = await girderRest.get<Pipelines>('viame/pipelines');
Expand Down Expand Up @@ -100,6 +118,8 @@ async function getValidWebImages(folderId: string) {
export {
deleteResources,
getAttributes,
setAttribute,
deleteAttribute,
getPipelineList,
makeViameFolder,
postProcess,
Expand Down
24 changes: 23 additions & 1 deletion client/src/components/TrackItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export default defineComponent({
components: { TooltipBtn },

props: {
solo: {
type: Boolean,
default: false,
},
trackType: {
type: String,
required: true,
Expand Down Expand Up @@ -84,7 +88,7 @@ export default defineComponent({

/* Sets styling for the selected track */
const style = computed(() => {
if (props.selected) {
if (props.selected && !props.solo) {
return {
'background-color': `${vuetify.theme.themes.dark.accentBackground}`,
};
Expand Down Expand Up @@ -212,7 +216,16 @@ export default defineComponent({
:style="style"
>
<v-row class="px-3 pt-2 justify-center item-row">
<div
v-if="solo"
class="type-color-box"
:style="{
backgroundColor: color,
}"
/>

<v-checkbox
v-else
class="my-0 ml-1 pt-0"
dense
hide-details
Expand Down Expand Up @@ -383,5 +396,14 @@ export default defineComponent({
background-color: #1e1e1e;
appearance: menulist;
}
.type-color-box {
margin: 7px;
margin-top: 4px;
min-width: 15px;
max-width: 15px;
min-height: 15px;
max-height: 15px;
}

}
</style>
3 changes: 3 additions & 0 deletions client/src/components/TrackList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ export default defineComponent({
Vue.nextTick(() => scrollToTrack(selectedTrackIdRef.value));
}

//If we mount with selected we scroll to it automatically
scrollToSelectedTrack();

function scrollPreventDefault(
element: HTMLElement,
keyEvent: KeyboardEvent,
Expand Down
6 changes: 3 additions & 3 deletions client/src/use/useTrackStore.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="jest" />
import Vue from 'vue';
import CompositionApi, { watchEffect } from '@vue/composition-api';
import useTrackStore from './useTrackStore';
import useTrackStore, { getTrack } from './useTrackStore';

Vue.use(CompositionApi);

Expand Down Expand Up @@ -50,9 +50,9 @@ describe('useTrackStore', () => {
it('throws an error when you access a track that is missing', () => {
const markChangesPending = () => null;
const ts = useTrackStore({ markChangesPending });
expect(() => ts.getTrack(0)).toThrow('TrackId 0 not found in trackMap.');
expect(() => getTrack(ts.trackMap, 0)).toThrow('TrackId 0 not found in trackMap.');
ts.addTrack(1000, 'foo');
expect(ts.getTrack(0)).toBeTruthy();
expect(getTrack(ts.trackMap, 0)).toBeTruthy();
});

it('updates a reactive list when member tracks change', async () => {
Expand Down
25 changes: 13 additions & 12 deletions client/src/use/useTrackStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ interface UseTrackStoreParams {
markChangesPending: (type: 'upsert' | 'delete', track?: Track) => void;
}

export function getTrack(
trackMap: Readonly<Map<TrackId, Track>>, trackId: Readonly<TrackId>,
): Track {
const track = trackMap.get(trackId);
if (track === undefined) {
throw new Error(`TrackId ${trackId} not found in trackMap.`);
}
return track;
}

/**
* TrackStore performs operations on a collection of tracks, such as
* add and remove. Operations on individual tracks, such as setting
Expand Down Expand Up @@ -38,14 +48,6 @@ export default function useTrackStore({ markChangesPending }: UseTrackStoreParam
return canary.value;
}

function getTrack(trackId: TrackId): Track {
const track = trackMap.get(trackId);
if (track === undefined) {
throw new Error(`TrackId ${trackId} not found in trackMap.`);
}
return track;
}

function getNewTrackId() {
return trackIds.value.length
? Math.max(...trackIds.value) + 1
Expand Down Expand Up @@ -87,7 +89,7 @@ export default function useTrackStore({ markChangesPending }: UseTrackStoreParam
if (trackId === null) {
return;
}
const track = getTrack(trackId);
const track = getTrack(trackMap, trackId);
const range = [track.begin, track.end];
if (!intervalTree.remove(range, trackId.toString())) {
throw new Error(`TrackId ${trackId} with range ${range} not found in tree.`);
Expand All @@ -108,7 +110,7 @@ export default function useTrackStore({ markChangesPending }: UseTrackStoreParam
*/
async function removeTracksBelowConfidence(thresh: number) {
trackIds.value.forEach((trackId) => {
const track = getTrack(trackId);
const track = getTrack(trackMap, trackId);
const confidence = track.getType();
if (confidence !== null && confidence[1] < thresh) {
removeTrack(trackId);
Expand All @@ -119,7 +121,7 @@ export default function useTrackStore({ markChangesPending }: UseTrackStoreParam
const sortedTracks = computed(() => {
_depend();
return trackIds.value
.map((trackId) => getTrack(trackId))
.map((trackId) => getTrack(trackMap, trackId))
.sort((a, b) => a.begin - b.begin);
});

Expand All @@ -129,7 +131,6 @@ export default function useTrackStore({ markChangesPending }: UseTrackStoreParam
intervalTree,
addTrack,
insertTrack,
getTrack,
getNewTrackId,
removeTrack,
removeTracksBelowConfidence,
Expand Down
2 changes: 2 additions & 0 deletions client/viame-web-common/apispec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ interface DatasetMeta extends DatasetMetaMutable {

interface Api {
getAttributes(): Promise<Attribute[]>;
setAttribute({ addNew, data }: {addNew: boolean | undefined; data: Attribute}): Promise<unknown>;
deleteAttribute(data: Attribute): Promise<unknown>;

getPipelineList(): Promise<Pipelines>;
runPipeline(itemId: string, pipeline: string): Promise<unknown>;
Expand Down
Loading