[Graph] Remove inferred edges leftover code (#50006)
This commit is contained in:
parent
0491589d50
commit
cbad2beea9
|
@ -894,10 +894,6 @@ module.exports = (function () {
|
|||
existingEdge.doc_count = Math.max(existingEdge.doc_count, edge.doc_count);
|
||||
continue;
|
||||
}
|
||||
// Inferred edges were a feature that used Levenshtein edit distance on node labels
|
||||
// to determine connections - removed that feature but may bring back.
|
||||
|
||||
const inferred = edge.inferred ? true : false;
|
||||
const newEdge = {
|
||||
'source': srcWrapperObj,
|
||||
'target': targetWrapperObj,
|
||||
|
@ -905,7 +901,6 @@ module.exports = (function () {
|
|||
'width': edge.width,
|
||||
'id': edge.id,
|
||||
'doc_count': edge.doc_count,
|
||||
'inferred': inferred
|
||||
};
|
||||
if (edge.label) {
|
||||
newEdge.label = edge.label;
|
||||
|
|
|
@ -377,61 +377,6 @@
|
|||
} }}"
|
||||
>{{mc.v2}}</small>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="gphSidebar__panel" ng-if="(detail.inferredEdge)">
|
||||
<div class="gphSidebar__header">
|
||||
<span class="kuiIcon fa-cog"></span>
|
||||
{{ ::'xpack.graph.sidebar.similarLabelsTitle' | i18n: { defaultMessage: 'Similar labels' } }}
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm gphFormGroup--small">
|
||||
<div style="line-height: 24px;">
|
||||
<button
|
||||
tooltip="{{ ::'xpack.graph.sidebar.similarLabels.mergeTargetToSrcButtonTooltip' | i18n: {
|
||||
defaultMessage: 'Merge {targetLabel} into {srcLabel}',
|
||||
values: { targetLabel: detail.inferredEdge.topTarget.label, srcLabel: detail.inferredEdge.topSrc.label },
|
||||
} }}"
|
||||
type="button" style="vertical-align: top;" class="kuiButton kuiButton--basic kuiButton--small"
|
||||
ng-click="performMerge(detail.inferredEdge.topTarget.id, detail.inferredEdge.topSrc.id)">
|
||||
<span class="kui fa-chevron-circle-down"></span>
|
||||
</button>
|
||||
<svg width="24" height="24">
|
||||
<circle class="gphNode__circle " r="10" cx="12" cy="12" ng-attr-style="fill:{{detail.inferredEdge.topSrc.color}}" />
|
||||
|
||||
<text ng-if="detail.inferredEdge.topSrc.icon" class="fa gphNode__text" text-anchor="middle" x="12" y="16">{{detail.inferredEdge.topSrc.icon.code}}</text>
|
||||
</svg>
|
||||
<span style="vertical-align: top;">{{detail.inferredEdge.topSrc.label}}</span>
|
||||
</div>
|
||||
<div style="line-height: 24px;">
|
||||
<button
|
||||
tooltip="{{ ::'xpack.graph.sidebar.similarLabels.mergeSrcToTargetButtonTooltip' | i18n: {
|
||||
defaultMessage: 'Merge {srcLabel} into {targetLabel}',
|
||||
values: { targetLabel: detail.inferredEdge.topTarget.label, srcLabel: detail.inferredEdge.topSrc.label },
|
||||
} }}"
|
||||
type="button" style="vertical-align: top;" class="kuiButton kuiButton--basic kuiButton--small"
|
||||
ng-click="performMerge(detail.inferredEdge.topSrc.id, detail.inferredEdge.topTarget.id)">
|
||||
<span class="kuiIcon fa-chevron-circle-up"></span>
|
||||
</button>
|
||||
|
||||
<svg width="24" height="24">
|
||||
<circle class="gphNode__circle " r="10" cx="12" cy="12" ng-attr-style="fill:{{detail.inferredEdge.topTarget.color}}" />
|
||||
|
||||
<text ng-if="detail.inferredEdge.topTarget.icon" class="fa gphNode__text" text-anchor="middle" x="12" y="16">{{detail.inferredEdge.topTarget.icon.code}}</text>
|
||||
</svg>
|
||||
<span style="vertical-align: top;">{{detail.inferredEdge.topTarget.label}}</span>
|
||||
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="col-sm-10"
|
||||
i18n-id="xpack.graph.sidebar.similarLabels.keyTermsText"
|
||||
i18n-default-message="Key terms: {inferredEdgeLabel}"
|
||||
i18n-values="{ html_inferredEdgeLabel: '<small>' + detail.inferredEdge.label + '</small>' }"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end edge-merge detail panel -->
|
||||
|
||||
|
|
|
@ -347,11 +347,7 @@ export function initGraphApp(angularModule, deps) {
|
|||
};
|
||||
|
||||
$scope.clickEdge = function (edge) {
|
||||
if (edge.inferred) {
|
||||
$scope.setDetail ({ 'inferredEdge': edge });
|
||||
}else {
|
||||
$scope.workspace.getAllIntersections($scope.handleMergeCandidatesCallback, [edge.topSrc, edge.topTarget]);
|
||||
}
|
||||
$scope.workspace.getAllIntersections($scope.handleMergeCandidatesCallback, [edge.topSrc, edge.topTarget]);
|
||||
};
|
||||
|
||||
$scope.submit = function (searchTerm) {
|
||||
|
|
|
@ -24,10 +24,6 @@
|
|||
stroke: $euiColorDarkShade;
|
||||
stroke-opacity: 0.95;
|
||||
}
|
||||
|
||||
&--inferred {
|
||||
stroke-dasharray: 5, 5;
|
||||
}
|
||||
}
|
||||
|
||||
.gphNode {
|
||||
|
|
|
@ -80,7 +80,6 @@ describe('graph_visualization', () => {
|
|||
];
|
||||
const edges: GroupAwareWorkspaceEdge[] = [
|
||||
{
|
||||
inferred: false,
|
||||
isSelected: true,
|
||||
label: '',
|
||||
topSrc: nodes[0],
|
||||
|
@ -91,7 +90,6 @@ describe('graph_visualization', () => {
|
|||
width: 2,
|
||||
},
|
||||
{
|
||||
inferred: false,
|
||||
isSelected: true,
|
||||
label: '',
|
||||
topSrc: nodes[1],
|
||||
|
|
|
@ -94,7 +94,6 @@ export function GraphVisualization({
|
|||
}}
|
||||
className={classNames('gphEdge', {
|
||||
'gphEdge--selected': edge.isSelected,
|
||||
'gphEdge--inferred': edge.inferred,
|
||||
})}
|
||||
style={{ strokeWidth: edge.width }}
|
||||
strokeLinecap="round"
|
||||
|
|
|
@ -91,8 +91,8 @@ describe('deserialize', () => {
|
|||
},
|
||||
],
|
||||
links: [
|
||||
{ inferred: false, label: '', weight: 5, width: 5, source: 2, target: 0 },
|
||||
{ inferred: false, label: '', weight: 5, width: 5, source: 2, target: 4 },
|
||||
{ label: '', weight: 5, width: 5, source: 2, target: 0 },
|
||||
{ label: '', weight: 5, width: 5, source: 2, target: 4 },
|
||||
],
|
||||
urlTemplates: [
|
||||
{
|
||||
|
|
|
@ -138,7 +138,6 @@ describe('serialize', () => {
|
|||
|
||||
// A <-> C
|
||||
appState.workspace.edges.push({
|
||||
inferred: false,
|
||||
label: '',
|
||||
source: appState.workspace.nodes[2],
|
||||
target: appState.workspace.nodes[0],
|
||||
|
@ -148,7 +147,6 @@ describe('serialize', () => {
|
|||
|
||||
// C <-> E
|
||||
appState.workspace.edges.push({
|
||||
inferred: false,
|
||||
label: '',
|
||||
source: appState.workspace.nodes[2],
|
||||
target: appState.workspace.nodes[4],
|
||||
|
@ -187,7 +185,6 @@ describe('serialize', () => {
|
|||
"indexPattern": "Testindexpattern",
|
||||
"links": Array [
|
||||
Object {
|
||||
"inferred": false,
|
||||
"label": "",
|
||||
"source": 2,
|
||||
"target": 0,
|
||||
|
@ -195,7 +192,6 @@ describe('serialize', () => {
|
|||
"width": 5,
|
||||
},
|
||||
Object {
|
||||
"inferred": false,
|
||||
"label": "",
|
||||
"source": 2,
|
||||
"target": 4,
|
||||
|
|
|
@ -36,13 +36,12 @@ function serializeNode(
|
|||
}
|
||||
|
||||
function serializeEdge(
|
||||
{ source, target, weight, width, inferred, label }: WorkspaceEdge,
|
||||
{ source, target, weight, width, label }: WorkspaceEdge,
|
||||
allNodes: WorkspaceNode[] = []
|
||||
): SerializedEdge {
|
||||
return {
|
||||
weight,
|
||||
width,
|
||||
inferred,
|
||||
label,
|
||||
source: allNodes.indexOf(source),
|
||||
target: allNodes.indexOf(target),
|
||||
|
|
|
@ -34,7 +34,6 @@ export interface WorkspaceNode {
|
|||
export interface WorkspaceEdge {
|
||||
weight: number;
|
||||
width: number;
|
||||
inferred: boolean;
|
||||
label: string;
|
||||
source: WorkspaceNode;
|
||||
target: WorkspaceNode;
|
||||
|
@ -60,7 +59,6 @@ export interface ServerResultEdge {
|
|||
weight: number;
|
||||
width: number;
|
||||
doc_count?: number;
|
||||
inferred: boolean;
|
||||
}
|
||||
|
||||
export interface GraphData {
|
||||
|
|
|
@ -4314,10 +4314,6 @@
|
|||
"xpack.graph.sidebar.selections.selectNoneButtonLabel": "なし",
|
||||
"xpack.graph.sidebar.selections.selectNoneButtonTooltip": "どれも選択しません",
|
||||
"xpack.graph.sidebar.selectionsTitle": "選択項目",
|
||||
"xpack.graph.sidebar.similarLabels.keyTermsText": "キー用語: {inferredEdgeLabel}",
|
||||
"xpack.graph.sidebar.similarLabels.mergeSrcToTargetButtonTooltip": "{srcLabel} を {targetLabel} に結合します",
|
||||
"xpack.graph.sidebar.similarLabels.mergeTargetToSrcButtonTooltip": "{targetLabel} を {srcLabel} に結合します",
|
||||
"xpack.graph.sidebar.similarLabelsTitle": "類似ラベル",
|
||||
"xpack.graph.sidebar.styleVerticesTitle": "スタイルが選択された頂点",
|
||||
"xpack.graph.sidebar.topMenu.addLinksButtonTooltip": "既存の用語の間にリンクを追加します",
|
||||
"xpack.graph.sidebar.topMenu.blacklistButtonTooltip": "選択項目がワークスペースに戻らないようブラックリストに追加します",
|
||||
|
|
|
@ -4315,10 +4315,6 @@
|
|||
"xpack.graph.sidebar.selections.selectNoneButtonLabel": "无",
|
||||
"xpack.graph.sidebar.selections.selectNoneButtonTooltip": "不选择任何内容",
|
||||
"xpack.graph.sidebar.selectionsTitle": "选择的内容",
|
||||
"xpack.graph.sidebar.similarLabels.keyTermsText": "关键字词:{inferredEdgeLabel}",
|
||||
"xpack.graph.sidebar.similarLabels.mergeSrcToTargetButtonTooltip": "将 {srcLabel} 合并到 {targetLabel}",
|
||||
"xpack.graph.sidebar.similarLabels.mergeTargetToSrcButtonTooltip": "将 {targetLabel} 合并到 {srcLabel}",
|
||||
"xpack.graph.sidebar.similarLabelsTitle": "类似标签",
|
||||
"xpack.graph.sidebar.styleVerticesTitle": "样式选择的顶点",
|
||||
"xpack.graph.sidebar.topMenu.addLinksButtonTooltip": "在现有字词之间添加链接",
|
||||
"xpack.graph.sidebar.topMenu.blacklistButtonTooltip": "返回工作空间时选择的黑名单",
|
||||
|
|
Loading…
Reference in a new issue