Skip to content

Commit

Permalink
update added very likely
Browse files Browse the repository at this point in the history
added js and CSS to create very likely description on document tones
over .75
  • Loading branch information
ACLM committed Dec 16, 2016
1 parent 7a96510 commit 4b62786
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
7 changes: 5 additions & 2 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,7 @@ pre[class*=" language-"] {
line-height: 1;
text-align: left;
font-weight: light;
width: 4rem;
font-size: 0.85rem; }
.summary-emotion-graph--label-container:hover .bar-graph--tooltip {
visibility: visible;
Expand Down Expand Up @@ -1696,7 +1697,8 @@ pre[class*=" language-"] {
line-height: 1;
text-align: left;
font-weight: light;
font-size: 0.85rem; }
font-size: 0.85rem;
width: 4rem; }
.summary-writing-graph--percentage-label-likeliness {
font-weight: light;
font-size: 0.5rem; }
Expand Down Expand Up @@ -1880,7 +1882,8 @@ pre[class*=" language-"] {
line-height: 1;
text-align: left;
font-weight: light;
font-size: 0.85rem; }
font-size: 0.85rem;
width: 4rem; }
.summary-social-graph--percentage-label-likeliness {
font-weight: light;
font-size: 0.5rem; }
Expand Down
15 changes: 9 additions & 6 deletions public/js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,12 @@ function allReady(thresholds, sampleText) {
function emotionMap(item) {
var v1 = app.percentagify(item.score, 'Emotion Tone');
var v2 = app.percentagify(app.thresholds().doc[item.tone_name][0]);
var v3 = app.percentagify(app.thresholds().doc[item.tone_name][1]);
return {
label: item.tone_name,
score: app.percentagify(item.score, 'Emotion Tone'),
tooltip: app.toneHash()[item.tone_name].tooltip,
likeliness: v1 > v2 ? 'LIKELY' : 'UNLIKELY',
likeliness: v1 > v3 ? 'VERY LIKELY' : v1 > v2 ? 'LIKELY' : 'UNLIKELY',
thresholdLow: app.percentagify(app.thresholds().doc[item.tone_name][0]),
thresholdHigh: app.percentagify(app.thresholds().doc[item.tone_name][1])
};
Expand All @@ -153,11 +154,12 @@ function allReady(thresholds, sampleText) {
function writingMap(item) {
var v1 = app.percentagify(item.score, 'Language Tone');
var v2 = app.percentagify(app.thresholds().doc[item.tone_name][0]);
var v3 = app.percentagify(app.thresholds().doc[item.tone_name][1]);
return {
label: item.tone_name,
score: app.percentagify(item.score, 'Language Tone'),
tooltip: app.toneHash()[item.tone_name].tooltip,
likeliness: v1 > v2 ? 'LIKELY' : 'UNLIKELY'
likeliness: v1 > v3 ? 'VERY LIKELY' : v1 > v2 ? 'LIKELY' : 'UNLIKELY'
};
}

Expand All @@ -169,11 +171,12 @@ function allReady(thresholds, sampleText) {
function socialMap(item) {
var v1 = app.percentagify(item.score, 'Social Tone');
var v2 = app.percentagify(app.thresholds().doc[item.tone_name][0]);
var v3 = app.percentagify(app.thresholds().doc[item.tone_name][1]);
return {
label: item.tone_name,
score: app.percentagify(item.score, 'Social Tone'),
tooltip: app.toneHash()[item.tone_name].tooltip,
likeliness: v1 > v2 ? 'LIKELY' : 'UNLIKELY'
likeliness: v1 > v3 ? 'VERY LIKELY' : v1 > v2 ? 'LIKELY' : 'UNLIKELY'
};
}

Expand Down Expand Up @@ -325,7 +328,7 @@ function allReady(thresholds, sampleText) {
*/
function updateJSONSentenceTones() {
$sentenceJson.empty();
$sentenceJson.html(JSON.stringify({'sentences_tone': data.sentences_tone}, null, 2));
$sentenceJson.text(JSON.stringify({'sentences_tone': data.sentences_tone}, null, 2));
}

/**
Expand All @@ -334,7 +337,7 @@ function allReady(thresholds, sampleText) {
*/
function updateJSONDocumentTones() {
$summaryJsonCode.empty();
$summaryJsonCode.html(JSON.stringify({'document_tone': data.document_tone}, null, 2));
$summaryJsonCode.text(JSON.stringify({'document_tone': data.document_tone}, null, 2));
}

/**
Expand Down Expand Up @@ -413,7 +416,7 @@ function allReady(thresholds, sampleText) {
message = 'You\'ve sent a lot of requests in a short amount of time. ' +
'As the CPU cores cool off a bit, wait a few seonds before sending more requests.';
}
$errorMessage.html(message);
$errorMessage.text(message);
$input.show();
$loading.hide();
$output.hide();
Expand Down

0 comments on commit 4b62786

Please sign in to comment.