jenkins-bot has submitted this change and it was merged.

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(-)

Approvals:
  Jonas Kress (WMDE): Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: Id5011fa3fa07797e14fab80c2a3e6b702c85d251
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to