Skip to content

Commit 551471b

Browse files
Merge pull request #47 from zazuko/virtual-scroll
imporve spo perormance
2 parents cbd69ab + d3190b8 commit 551471b

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

src/App.vue

+23-8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Splitter from 'primevue/splitter';
77
import SplitterPanel from 'primevue/splitterpanel';
88
import Select from 'primevue/select';
99
import Dialog from 'primevue/dialog';
10+
import Drawer from 'primevue/drawer';
1011
1112
import RdfEditor from './components/RdfEditor.vue';
1213
import type { RdfData } from './components/RdfEditor.vue';
@@ -30,7 +31,9 @@ const rdfText = ref<string>('');
3031
const currentSerialization = computed(() => selectedFormat.value.type);
3132
const dataset = ref<Dataset>(rdfEnvironment.dataset() as unknown as Dataset);
3233
const hideEditorSplitterPanel = ref(false);
33-
const hideSearchPanel = ref(true);
34+
const showTable = ref(false);
35+
const showSearchPanel = ref(false);
36+
3437
const showAboutDialog = ref(false);
3538
3639
function onQuadsChanged(rdfData: RdfData) {
@@ -47,7 +50,7 @@ function makeEditorBig() {
4750
}
4851
4952
function toggleSearch () {
50-
hideSearchPanel.value = !hideSearchPanel.value;
53+
showSearchPanel.value = !showSearchPanel.value;
5154
}
5255
5356
function onFormatChange(rdfSerializationType: RdfSerializationType) {
@@ -110,15 +113,27 @@ function onNdeSelected(term: Term) {
110113
<GraphView :dataset="dataset" />
111114
</SplitterPanel>
112115

113-
<SplitterPanel v-if="!hideSearchPanel">
114-
<SPOSearch :dataset="dataset" @selected="onNdeSelected"/>
115-
</SplitterPanel>
116-
117116
</Splitter>
118117

119118

120-
121-
<Dialog v-model:visible="showAboutDialog" modal header="Zazuko RDF Sketch" :style="{ width: '60rem' }">
119+
<Drawer v-model:visible="showSearchPanel" header="SPO Search" :modal="false" position="bottom" :dismissable="false" style="height: 40vh" :pt="{
120+
root: {
121+
style: 'padding: 0;'
122+
},
123+
content: {
124+
style: 'padding: 0;'
125+
},
126+
title: {
127+
style: 'font-size: 16px; font-weight: 600;'
128+
},
129+
header: {
130+
style: 'padding-left: 16px; padding-top:0; padding-bottom:0; padding-right: 0px; '
131+
132+
}}">
133+
<SPOSearch :dataset="dataset" @selected="onNdeSelected"/>
134+
</Drawer>
135+
136+
<Dialog v-model:visible="showAboutDialog" header="Zazuko RDF Sketch" :style="{ width: '60rem' }">
122137
<div style="display: flex; flex-direction: row; gap: 24px">
123138
<img src="/img/icons/zazuko_icon.svg" alt="Zazuko Logo" style="width: 100px;">
124139

src/components/SPOSearch.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<DataTable v-model:filters="filters" filterDisplay="row" :value="spo" scrollable scrollHeight="flex">
2+
<ProgressSpinner v-if="!spo" />
3+
4+
5+
<DataTable v-if="spo" v-model:filters="filters" filterDisplay="row" :value="spo" :itemSize="61" scrollable scrollHeight="calc(40vh - 42px)" :virtualScrollerOptions="{ itemSize: 61 }" >
36
<Column field="subject" header="Subject" style="width: 20%">
47
<template #filter="{ filterModel, filterCallback }">
58
<InputText size="small" v-model="filterModel.value" type="text" @input="filterCallback()" placeholder="Search Subject" />
@@ -25,7 +28,7 @@
2528
<InputText size="small" v-model="filterModel.value" type="text" @input="filterCallback()" placeholder="Search Object" />
2629
</template>
2730
<template #body="{ data }">
28-
<span v-if="data.predicateTerm.value === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' || data.objectTerm.termType === 'Literal'">
31+
<span class="row" v-if="data.predicateTerm.value === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' || data.objectTerm.termType === 'Literal'">
2932
{{ data.object }}
3033
</span>
3134
<span v-else @click="nodeSelected(data.objectTerm)" class="node-link">
@@ -43,6 +46,7 @@
4346
</template>
4447

4548
<script setup lang="ts">
49+
import ProgressSpinner from 'primevue/progressspinner';
4650
4751
import type { Dataset, Term } from '@rdfjs/types';
4852
import { computed, ref } from 'vue'

src/resources-utils.ts

-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ function mapTypeToLabel(typeIri: string): string {
9999
const lastPart = iriParts[iriParts.length - 1];
100100

101101
const cc = lastPart.replace(/[a-z]/g, '');
102-
console.log(lastPart);
103-
console.log(cc);
104102
if (cc.length > 1) {
105103

106104
return cc.slice(0, 2);

0 commit comments

Comments
 (0)