Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
adding red color to show loose coupling (#239)
Browse files Browse the repository at this point in the history
Fixes #235
  • Loading branch information
Helene Rignér authored Apr 23, 2019
1 parent 884a5e7 commit 76e4eb4
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
Binary file added data/circref.qvf
Binary file not shown.
3 changes: 2 additions & 1 deletion src/components/table-field.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ function TableFieldWithoutState({
classes += ' single-hit';
}

const stroke = fieldData.srcTable.qLoose ? 'dashed' : 'solid';
const fieldStyle = {
border: `2px solid ${fieldData.backgroundColor}`,
border: `2px ${stroke} ${fieldData.backgroundColor}`,
};

const filterBox = showFilterbox ? <Filterbox model={model} layout={layout} field={field} /> : null;
Expand Down
14 changes: 14 additions & 0 deletions src/components/tooltip.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ export function getExtraInfoForField(fieldData) {
const avgDup = rowWithValueCount > uniqueValueCount ? `~ ${(rowWithValueCount / uniqueValueCount).toFixed(3)}` : '1';

function keyDescription() {
if (fieldData.srcTable.qLoose) {
return (
<React.Fragment>
<div className="headerContainer">
<h3 className="loose">Circular reference</h3>
</div>
<span>The red color indicates a circular reference.</span>
<p>
To avoid ambiguous results, table <i>{fieldData.srcTable.qName}</i> is marked as “loosely coupled”,
which means that the logical inference cannot propagate through this table. Avoid circular references.
</p>
</React.Fragment>
);
}
switch (fieldData.qKeyType) {
case 'PERFECT_KEY':
return (
Expand Down
4 changes: 4 additions & 0 deletions src/components/tooltip.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
display: inline;
}

.loose {
color: #c00;
}

.perfect-key {
color: #398ab5;
}
Expand Down
3 changes: 3 additions & 0 deletions src/logic/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ function mixColors(color1, color2, weight) {
}

function colorOfField(field) {
if (field.srcTable.qLoose) {
return '#cc0000';
}
switch (field.qKeyType) {
case 'PERFECT_KEY':
return '#398ab5';
Expand Down

0 comments on commit 76e4eb4

Please sign in to comment.