Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop-2.0.0' into develop-2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wmqwxb committed Dec 19, 2023
2 parents f5ccba9 + fa55b93 commit 3bbdab4
Show file tree
Hide file tree
Showing 21 changed files with 236 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
class="f-p-table"
:header="header"
:data="data"
:pageSize="10"
:total="total"
:size="10"
:total="data.length"
:index="true"
>
</FTable>
Expand Down Expand Up @@ -40,6 +40,7 @@
:max="1"
:min="0"
:pearson="false"
:ext="tooltipFormatter"
>
</FHeatMap>
</section>
Expand All @@ -49,8 +50,10 @@

<script lang="ts" setup>
import { computed, onBeforeMount, ref, watch } from 'vue';
import { useStore } from 'vuex';
import RoleSelection from './selection.vue';
const store = useStore()
const props = defineProps([
'header',
'data',
Expand All @@ -59,20 +62,26 @@ const props = defineProps([
'localData',
'remoteData',
]);
const total = computed(() => {
return props.data ? props.data.length : 0;
});
const role = computed(() => store.state.job.details?.fRole);
const selectonRole = [
{
label: 'all',
value: 'all',
},
{
];
if (role.value?.match(/guest/i)) {
selectonRole.push({
label: 'guest',
value: 'guest',
}
];
})
}
if (role.value?.match(/host/i)) {
selectonRole.push({
label: 'host',
value: 'guest',
})
}
const selected = ref('all');
const correlation = ref<string[]>([]);
Expand Down Expand Up @@ -116,13 +125,41 @@ const correlationData = computed(() => {
const yImply = props.localData[y] || props.remoteData[y] || {};
result = yImply[x] ? Number(yImply[x].toFixed(6)) : yImply[x]
}
if (!result) {
const yImply = props.remoteData[x] || props.remoteData[x] || {};
result = yImply[y] ? Number(yImply[y].toFixed(6)) : yImply[y]
}
if (!result) {
const yImply = props.remoteData[y] || props.remoteData[y] || {};
result = yImply[x] ? Number(yImply[x].toFixed(6)) : yImply[x]
}
row.push(result);
}
corrData.push(row);
}
return corrData;
});
const tooltipFormatter = {
tooltip: {
formatter: (params: any) => {
const [xc, yc, data] = params.data
const x = correlation.value[xc]
const y = correlation.value[yc]
let getAnonym = (imp: any) => {
const cursor = props.data.findIndex((item: any) => item.variable === imp)
if (cursor >= 0) {
return props.data[cursor].anonym
}
return ''
}
const xanony = getAnonym(x)
const yanony = getAnonym(y)
return `features: ${x}${xanony ? '(' + xanony + ')' : ''}, ${y}${yanony ? '(' + yanony + ')' : ''} <br /> coefficient: ${data}`
}
}
}
const coefficient = () => {
pearsonMap.value.displayLabel();
};
Expand Down Expand Up @@ -166,6 +203,7 @@ watch(
background: var(--el-bg-color);
border: 1px solid var(--el-color-info-light-9);
border-radius: 2px;
padding-top: 12px;
}
.f-p-map-header {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default {
} else {
ElMessage({
showClose: true,
message: `There has no configuration yml for component ${name}`,
message: `There has no configuration yaml for component ${name}`,
center: true,
type: 'error'
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export default {
})
})
}
return true
},

async parameterRequest({ state, commit, dispatch }: any) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
@import './common.scss';
@import './border.scss';
@import './font.scss';
@import './animation.scss';
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ export default function feature_correlation (
const { local_corr, remote_corr, vif } = data
const { column_anonymous_map } = meta

const isHost = role.match(/host/i)

const theader = <any>[{
label: 'variable',
prop: 'variable',
width: 100,
width: 90,
}]
let tdata = []

Expand All @@ -29,7 +31,7 @@ export default function feature_correlation (
theader.push({
label: 'anonym',
prop: 'anonym',
width: 120,
width: 130,
})
}

Expand Down Expand Up @@ -62,7 +64,11 @@ export default function feature_correlation (

let remote_key = Object.keys(remote_corr || {})
if (remote_key && remote_key.length > 0) {
remote_key = sort(remote_key)
if (!isHost) {
remote_key = sort(remote_key)
} else {
remote_key = sort(Object.keys(remote_corr[remote_key[0]]))
}
}

const correlation = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export default function hetero_feature_selection(
const toMetricsData = tData[current] || [];
const toMetricsHeader = tHeader[current] || [...defaultHeader];
for (const variable in all_selected_mask) {
const row: any = {};
const cursor = toMetricsData.findIndex((item: any) => item.variable === variable)
const row: any = cursor < 0 ? {} : toMetricsData[cursor];
row['variable'] = variable;
for (const col in all_selected_mask[variable]) {
if (!toMetricsHeader.some((item: any) => item.prop === col)) {
Expand All @@ -78,7 +79,9 @@ export default function hetero_feature_selection(
if (selected_mask && !isUndefined(selected_mask[variable])) {
row._filter = !selected_mask[variable];
}
toMetricsData.push(row);
if (cursor < 0) {
toMetricsData.push(row);
}
}
tHeader[current] = toMetricsHeader;
tData[current] = toMetricsData;
Expand All @@ -90,15 +93,15 @@ export default function hetero_feature_selection(
prop: method,
});
for (const variable in selected_mask) {
const row: any = {};
row['variable'] = variable;
row[method] = '-';
row._filter = !selected_mask[variable];
const cursor = toMethodData.findIndex(
(item: any) => item['variable'] === variable
);
if (cursor >= 0) {
Object.assign(toMethodData[cursor], row);
const row: any = cursor < 0 ? {} : toMethodData[cursor];
row['variable'] = variable;
row[method] = '-';
row._filter = !selected_mask[variable];
if (cursor < 0) {
toMethodData.push(row)
}
}
tHeader[current] = toMethodHeader;
Expand All @@ -117,7 +120,10 @@ export default function hetero_feature_selection(
const toHostData = tData[option] || [];
const toHostHeader = tHeader[option] || [...defaultHeader];
for (const variable in all_host_selected_mask[option]) {
const row: any = {};
const cursor = toHostData.findIndex(
(item: any) => item['variable'] === variable
);
const row: any = cursor < 0 ? {} : toHostData[cursor];
row['variable'] = variable;
for (const col in all_host_metrics[option][variable]) {
if (!toHostHeader.some((item: any) => item.prop === col)) {
Expand All @@ -135,13 +141,8 @@ export default function hetero_feature_selection(
if (selected_mask && !isUndefined(selected_mask[variable])) {
row._filter = !selected_mask[variable];
}

const cursor = toHostData.findIndex(
(item: any) => item['variable'] === variable
);
if (cursor >= 0) {
Object.assign(toHostData[cursor], row);
} else {

if (cursor < 0) {
toHostData.push(row)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,46 @@
<article class="f-dashboard-dataset--title">Parties info</article>

<section class="f-dashboard-dataset--main">
<el-row
v-for="(item, index) in parties"
:gutter="24"
class="f-dashboard-dataset--row"
>
<el-col :span="6">
<FRow
:label="'Role'"
:labelClassName="'f-dashboard-dataset--label'"
:content="item.role"
:contentClassName="'f-dashboard-dataset--content'"
></FRow>
</el-col>
<el-col :span="14">
<FRow
:label="'PartyId'"
:labelClassName="'f-dashboard-dataset--label'"
:content="(item.party_id || []).join(', ')"
:contentClassName="'f-dashboard-dataset--content'"
></FRow>
</el-col>
</el-row>
<template v-for="(item, key) in dataset">
<el-row
:gutter="24"
class="f-dashboard-dataset--row f-dashboard-dataset--subtitle"
>
<el-col :span="8"><article class="f-dashboard-dataset--label">{{ capitalize(key.toString() || '') }}</article></el-col>
<el-col :span="16"><article class="f-dashboard-dataset--label">Dataset</article></el-col>
</el-row>
<template v-for="(namespace, partyid) in item">
<el-row
:gutter="24"
class="f-dashboard-dataset--row"
>
<el-col :span="8">
<article class="f-dashboard-dataset--content">{{ partyid }}</article>
</el-col>
<el-col :span="16">
<article class="f-dashboard-dataset--column">
<article
v-for="(name, index) in namespace"
class="f-dashboard-dataset--content">
{{ `${name.namespace}.${name.name}` }}
</article>
</article>
</el-col>
</el-row>
</template>
</template>
</section>
</article>
</template>

<script lang="ts" setup>
import { capitalize } from 'lodash';
import { computed } from 'vue';
import { useStore } from 'vuex';
const store = useStore();
const parties = computed(() => store.state.job.dataset.parties || []);
const dataset = computed(() => store.state.job.dataset.dataset || {});
</script>

<style lang="scss" scoped>
Expand Down Expand Up @@ -66,11 +73,16 @@ const parties = computed(() => store.state.job.dataset.parties || []);
flex: 2 2 calc(100% - 18px - $pale);
max-height: calc(100% - 18px - $pale);
background-color: var(--el-bg-color);
overflow-y: auto;
overflow-x: hidden;
}
.f-dashboard-dataset--row {
padding: $pale;
padding: math.div($pale, 2) $pale;
&:first-child {
padding-top: $pale * 2;
}
:deep(.f-dashboard-dataset--label) {
@include font-title();
Expand All @@ -80,6 +92,18 @@ const parties = computed(() => store.state.job.dataset.parties || []);
@include font-text();
font-weight: bold;
}
.f-dashboard-dataset--column {
@include flex-col();
}
}
.f-dashboard-dataset--subtitle {
margin-top: $pale;
&:first-child{
margin-top: 0;
}
}
}
</style>
Loading

0 comments on commit 3bbdab4

Please sign in to comment.