Lucas Werkmeister has uploaded a new change for review.
https://gerrit.wikimedia.org/r/305189
Change subject: Color graph nodes based on rgb column if present
......................................................................
Color graph nodes based on rgb column if present
See 7196679 for details, which added this feature to the bubble chart.
This is just the same feature for the graph.
Change-Id: Id5011fa3fa07797e14fab80c2a3e6b702c85d251
---
M wikibase/queryService/ui/resultBrowser/GraphResultBrowser.js
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui
refs/changes/89/305189/1
diff --git a/wikibase/queryService/ui/resultBrowser/GraphResultBrowser.js
b/wikibase/queryService/ui/resultBrowser/GraphResultBrowser.js
index 62f15b6..d5c205f 100644
--- a/wikibase/queryService/ui/resultBrowser/GraphResultBrowser.js
+++ b/wikibase/queryService/ui/resultBrowser/GraphResultBrowser.js
@@ -148,6 +148,12 @@
node.title += ' value:' + field.value;
node.shape = 'dot';
}
+
+ if ( key === 'rgb' && format.isColor( field ) ) {
+ node.color = format.getColorForHtml( field );
+ var foreground = format.calculateLuma(
field.value ) <= 0.5 ? '#FFF' : '#000';
+ node.font = { color: foreground };
+ }
} );
return {
--
To view, visit https://gerrit.wikimedia.org/r/305189
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5011fa3fa07797e14fab80c2a3e6b702c85d251
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits