Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sunburst panel #169

Merged
merged 4 commits into from Apr 17, 2015
Merged

Sunburst panel #169

merged 4 commits into from Apr 17, 2015

Conversation

nickvasilyev
Copy link
Contributor

I have a new sunburst panel. It looks similar to http://bl.ocks.org/kerryrodden/7090426 and is powered by solr facet pivot. Configuration involves entering a list of fields to run facet pivot on, like field1,field2,field3 and configuring a facet limit. In the future, I can implement a per field facet limit.

When clicked on any slice of the doughnut, it will create filters based on the item and it's parents, then reload the dashboard.

I did some testing on it, but couldn't spend as much time on it as I wanted to. A second pair of eyes would help.

Let me know what you think.

image 1

image

@nickvasilyev nickvasilyev changed the title Develop Sunburst panel Apr 15, 2015
@dougmcclure
Copy link

beautiful! I'll give this a try. I would love to learn how to create these!

@dougmcclure
Copy link

I'm seeing nothing render in the panel. I can see results from the query for all the facets. Any ideas? Chrome is my browser, I cleared all cache after uploading your panel and making the change to config.js.

Tks!

Doug

snip
facet_counts": {
"facet_queries": {},
"facet_fields": {},
"facet_dates": {},
"facet_ranges": {},
"facet_pivot": {
"fieldA,fieldB": [
[
"field",
"fieldA",
"value",
"BASLIGHT",
"count",
3245,
"pivot",
[
[
"field",
"fieldB",
"value",
"Very Low",
"count",
1896
],
[
"field",
"fieldB",
"value",
"Very High",
"count",
522
],
[
"field",
"fieldB",
"value",
"Low",
"count",
492
],
[
"field",
"fieldB",
"value",
"Medium",
"count",
334
],
[
"field",
"fieldB",
"value",
"Medium High",
"count",
1
]

@nickvasilyev
Copy link
Contributor Author

Great, thanks for testing this.

Can you send me the full json output from Solr? You can find if you have chrome Dev tools open under the network section.

@nickvasilyev
Copy link
Contributor Author

Hi Doug,

I fixed your data to look like facet.pivot output, ie:
var testdata = {
"fieldA,fieldB": [
{
"field":"fieldA",
"value":"BASLIGHT",
"count":3245,
"pivot":[
{
"field":"fieldB",
"value":"Very Low",
"count":1896
},
{
"field":"fieldB",
"value":"Very High",
"count":522
},
{
"field":"fieldB",
"value":"Low",
"count":492
},
{
"field":"fieldB",
"value":"Medium",
"count":334},
{
"field":"fieldB",
"value":"Medium High",
"count":1
}]}]}

and was able to load the panel without a problem

image

@dougmcclure
Copy link

how do we troubleshoot?

The data is there in the browser dev tools console query response.

@nickvasilyev
Copy link
Contributor Author

The data you posted does not look like facet.pivot json response. It has commas instead of semicolons and some nodes are lists instead of objects. Can you tell me where you got that from?

@dougmcclure
Copy link

Here's a more complete one I hope (still sanitized). This is from the Chrome devtools console.

This system is using SolrCloud and a collection alias which represents all the collections in my environment.

https://10.0.0.1:9987/doug/solr/my_collection_alias/select?q=_datasource%3A%22Data%20Test%20Stream%22&fq=timestamp:[NOW/DAY-30DAY%20TO%20NOW/DAY%2B1DAY]&wt=json&facet=true&facet.pivot=fieldA,fieldB&facet.limit=1000

{
"responseHeader": {
"status": 0,
"QTime": 1932,
"params": {
"facet": "true",
"q": "_datasource:"Data Test Stream"",
"facet.limit": "1000",
"wt": "json",
"facet.pivot": "fieldA,fieldB",
"fq": "timestamp:[NOW/DAY-30DAY TO NOW/DAY+1DAY]"
}
},
"response": {
"numFound": 38912,
"start": 0,
"maxScore": 6.444475,
"docs": [
--snip--
]
},
"facet_counts": {
"facet_queries": {},
"facet_fields": {},
"facet_dates": {},
"facet_ranges": {},
"facet_pivot": {
"fieldA,fieldB": [
[
"field",
"fieldA",
"value",
"BASLIGHT",
"count",
38912,
"pivot",
[
[
"field",
"fieldB",
"value",
"Very Low",
"count",
13467
],
[
"field",
"fieldB",
"value",
"Low",
"count",
11778
],
[
"field",
"fieldB",
"value",
"Medium",
"count",
8909
],
[
"field",
"fieldB",
"value",
"Very High",
"count",
3623
],
[
"field",
"fieldB",
"value",
"Medium High",
"count",
847
],
[
"field",
"fieldB",
"value",
"High",
"count",
288
]
]
]
]
}
}
}

@dougmcclure
Copy link

sorry, it's also Solr 4.7.1.

@nickvasilyev
Copy link
Contributor Author

There is something wrong with your Solr Output.

This is the output I am getting on solr cloud 4.6 with a collection alias, with some notes on why your output is different.

"facet_pivot":{
"fieldA,fieldB":[{ <---- See how there is a squiggly bracket here, you have a square one instead
"field":"fieldA", <--- See how for each one of these, there is a colon, not a comma separating
"value":"00000000", ---- keys and values
"count":254628,
"pivot":[{ <--- here again, square bracket followed by squiggly
"field":"FieldB",
"value":"VALA",
"count":2},
{
"field":"FieldB",
"value":"VALB",
"count":2}]},

@dougmcclure
Copy link

Any ideas on what would cause that? A change in 4.7.1 maybe?

@nickvasilyev
Copy link
Contributor Author

Hi Doug,
No idea, can you visually confirm this by querying solr directly? It is very weird, because the output you posted doesn't conform to json standards, so everything would break if Solr was outputting it. Do other panels that rely on facet pivot like heatmap work for you?

@dougmcclure
Copy link

I've never gotten heatmap to work. I run the query string in browser to
solr direct and the results look same to my eyes:

{
"responseHeader": {
"status": 0,
"QTime": 53,
"params": {
"facet": "true",
"q": "_datasource:"blah"",
"facet.limit": "1000",
"wt": "json",
"facet.pivot": "fieldA,fieldB",
"fq": "timestamp:[NOW/DAY-30DAY TO NOW/DAY+1DAY]"
}
},
"response": {
"numFound": 38912,
"start": 0,
"maxScore": 6.444475,
"docs": [

snip
]
},
"facet_counts": {
"facet_queries": {},
"facet_fields": {},
"facet_dates": {},
"facet_ranges": {},
"facet_pivot": {
"fieldA,fieldB": [
[
"field",
"fieldA",
"value",
"BASLIGHT",
"count",
38912,
"pivot",
[
[
"field",
"fieldB",
"value",
"Very Low",
"count",
13467
],
[
"field",
"fieldB",
"value",
"Low",
"count",
11778
],
[
"field",
"fieldB",
"value",
"Medium",
"count",
8909
],
[
"field",
"fieldB",
"value",
"Very High",
"count",
3623
],
[
"field",
"fieldB",
"value",
"Medium High",
"count",
847
],
[
"field",
"fieldB",
"value",
"High",
"count",
288
]
]
]
]
}
}
}

On Fri, Apr 17, 2015 at 2:59 PM, Nick Vasilyev notifications@github.com
wrote:

Hi Doug,
No idea, can you visually confirm this by querying solr directly? It is
very weird, because the output you posted doesn't conform to json
standards, so everything would break if Solr was outputting it. Do other
panels that rely on facet pivot like heatmap work for you?


Reply to this email directly or view it on GitHub
#169 (comment).

@aadel
Copy link
Contributor

aadel commented Apr 17, 2015

@wrdrvr Very nice! Got this running without any problems on 4.9.0. I think it would be nice to have an option for legend and show labels on segments. There's a small glitch that keeps tool-tips permanently visible after adding filters (clicking on segments).

@dougmcclure the output above is weird, not JSON format. Could be something specific to pivot and aliasing in 4.7.1?

@nickvasilyev
Copy link
Contributor Author

Hi Ahmed,
Thanks, I will into the glitch. As for labels and legend, I think it would be nice too, but I am not sure where to place it, especially considering the large number of possible values.

@dougmcclure
Copy link

thanks- I'll ask our dev guys if we've done anything to a stock Solr 4.7.1
package in the faceting/pivoting area.

Nick - if you have any more works of art like this, I'd love to help
somehow. I've been very keen on the d3 sankey diagrams and think they'd be
very cool for visualizing data moving from source to destinations, user
transaction flows, etc.

On Fri, Apr 17, 2015 at 4:13 PM, Nick Vasilyev notifications@github.com
wrote:

Hi Ahmed,
Thanks, I will into the glitch. As for labels and legend, I think it would
be nice too, but I am not sure where to place it, especially considering
the large number of possible values.


Reply to this email directly or view it on GitHub
#169 (comment).

Fixed tooltips that were hanging around after reload and added rows=0 to
Solr query.
Removed a no longer needed function and fixed loading indicator.
@nickvasilyev
Copy link
Contributor Author

@aadel I was able to replicate the persistent tooltip by having one display while the panel reloaded. I am not sure why it was hanging around, but I am removing all sunburst tooltips on re-render now. I think this should fix it.

Also, I noticed a problem with the loading indicator. It was only on while the data was being fetched, but it may take a few seconds to render the panel, so I moved it in the D3 code.

@dougmcclure
That is a cool chart, I would like to see something like this as well. I will try to play with it a bit once I have some free time.

@aadel
Copy link
Contributor

aadel commented Apr 17, 2015

@wrdrvr I think legend can go on any of the four directions (similar to terms panel) but as you mentioned values will be most probably too many especially when there are several layers (circles), the legend is just nice to have and can be hidden by default.

@nickvasilyev
Copy link
Contributor Author

@aadel Ok, I will take a stab at it when I have a bit more time.

@aadel
Copy link
Contributor

aadel commented Apr 17, 2015

@wrdrvr confirmed the tooltip issue is fixed. Thanks for the contribution!

@dougmcclure +1 for having Sankey diagrams. They are very useful for analyzing flows such as transactions or energy and would be cool have.

aadel added a commit that referenced this pull request Apr 17, 2015
@aadel aadel merged commit de0fb31 into lucidworks:develop Apr 17, 2015
@nickvasilyev nickvasilyev deleted the develop branch April 17, 2015 22:28
athana added a commit that referenced this pull request Mar 3, 2016
    Update README.md
    Upgrade jquery from v1.8.0 to v1.12.1 to fix security vulnerability.
    Cleanup histogram panel.
    Add NOTICE.txt
    Add default form submit action when creating a new dashboard.
    Add show stats value to Hits panel.
    Merge branch 'MAVEN_CENTRAL' of https://github.com/lewismc/banana into lewismc-MAVEN_CENTRAL
    Fix d3.tip module.
    Merge branch 'add-panel-d3-bar-with-tooltip' of https://github.com/ankit-singhaniya/banana into ankit-singhaniya-add-panel-d3-bar-with-tooltip
    Merge branch 'ankit-singhaniya-tag-cloud-panel-stop-words' into develop
    Merge branch 'tag-cloud-panel-stop-words' of https://github.com/ankit-singhaniya/banana into ankit-singhaniya-tag-cloud-panel-stop-words
    Merge pull request #258 from frankdarcy/develop
    only create mailto link for username after whitespace or line start
    Edit .gitignore
    Remove unused ajax-solr lib.
    Remove (unused) bower from package.json.
    Fix bootstrap.dark.min.css and bootstrap.light.min.css.
    Fix Gruntfile and update grunt-contrib-uglify from 0.5.1 to 0.11.0.
    Fix Grunt default task.
    Revise package.json and bower.json.
    Only create mailto link if username is at start of line or preceeded by whitespace (to avoid matching ftp://user:password@host/path)
    Add world-antarctica map.
    Edit map.world.codes.js to capitalized case.
    Fix filter when using countryName option in map panel.
    Add banana-int conf directory for Solr 5.x
    Update README.md to include instructions for Solr 5.
    Merge pull request #234 from davidfmiller/develop
    Apple touch icon
    Merge pull request #222 from davidfmiller/patch-7
    Update filesaver.js to latest version
    Merge branch 'davidfmiller-jshint' into develop
    Remove redundant fq condition
    Merge branch 'davidfmiller-export' into develop
    Fixed terms export rows parameter
    Merge pull request #226 from davidfmiller/editorconfig
    Add initial .editorconfig file
    Merge pull request #227 from davidfmiller/export
    Centralize downloading/exporting response data
    Add export to terms panel
    Only display 'all fields checkbox' for table module
    Centralize downloading/exporting response data
    jshint fixes for dashUpload and kibanaPanel
    jshint fixes
    Merge pull request #221 from davidfmiller/develop
    Translation of field names in table micropanel
    Add field name translation in table panel
    Add field name translation in full text search panel
    Allow human-friendly translations for facet fields to be defined on a per-dashboard basis
    Merge pull request #215 from davidfmiller/develop
    Update browser window/tab title to reflect current dashboard title
    Merge pull request #206 from davidfmiller/develop
    JS Docs for underscore.extended.js + kbn.js in src/app/components
    Add "sorted" clarification to get_object_fields method description
    add build.number to .gitignore
    JS docs for underscore.extended + kbn
    Merge pull request #205 from davidfmiller/develop
    Method documentation & typo clean-up in kbn.js
    Merge pull request #204 from jbrucher/patch-1
    Fix map panel height under IE 9-11
    In IE 9-11 the panel height or row height is not recognized probably and therefor the default height of 20px is always set.
    Changing line 62 to use ng-syle IE is recognizing style propably!
    Tested for both IE and FF.
    Merge pull request #199 from aadel/solr5-cors
    Solr 5 CORS update
    Merge pull request #179 from nickvasilyev/develop
    Issue #52 Fix. Thanks Nick!
    Merge pull request #197 from wlbhiro/develop
    Fix : Bug exclude_filter of value change to Empty value.
    Add a new panel called docviewer for displaying a search result like a document viewer with a title field and a content field with highlighting.
    Adding D3 Bar Chart Panel
    Adding Option to Ignore Stop Words (English) from Tag Cloud
    Adding (as an option in panel settings) to use Country Names to Detect Countries from the Result rather than using Country Codes
    Adding Antarctica Region to World Map in Map Panel
    Merge pull request #169 from wrdrvr/develop
    Sunburst panel
    Removed unused code and fixed the loading indicator
    Removed a no longer needed function and fixed loading indicator.
    Fixed persistent tooltip, set rows to 0 in query
    Fixed tooltips that were hanging around after reload and added rows=0 to
    Added a sunburst panel
    Merge pull request #163 from iperminov/develop
    Filtering panel: wrap and truncate long values to display
    Merge pull request #159 from iperminov/develop
    Use POST instead of GET in Solr client to do search
    Merge pull request #152 from dhasenfratz/develop
    Ticker Panel Bug: Custom query is always ignored
    Add figures for tutorial on how to build a custom panel.
    Reformat the code for template panel.
    Add template panel for tutorial on how to build a custom panel.
    Add thousandSeparator filter to format numbers.
    Add a new solrSrv service. This will be used to enhance and optimize Solr requests.
    Improve micro panel in the Table panel by adding an option to calculate the top field values from all data in Solr.
    Table panel will now dynamically display non-empty fields on the field list.
    Fix: Turn off sorting in Table panel by default.
    Add option to limit the max number of facet fields to Facet panel, and cleanup code.
    Merge pull request #146 from titellus/improvements/panels/terms/add-sort-by-count-or-index
    Dashboard / Term panel / Add sort by index or count.
    Fix syntax errors when using strict equality in ng-show and ng-hide directives. Change to == instead.
    Merge pull request #140 from titellus/improvements/panels/filter/set-filter-from-location-search-q-parameter
    Filter panel / Initialize filters from q parameter in location.
    Filter panel / Trigger refresh on load.
    Merge pull request #112 from karimfikry/develop
    Fix change Heatmap cells color update
    Merge pull request #114 from tarek-salah/fix_toggle_button
    Fix toggle in filter panel
    Fixed change color of heatmap cells
    Merge pull request #109 from tarek-salah/develop
    Validate empty fields when adding to *Table* panel
    Merge pull request #100 from karimfikry/develop
    Fixing Table paging issue after refresh
    Merge pull request #107 from aadel/configurable_timefield
    Configurable timefield in new dashboard pop-up.
    Fix table panel: adding empty fields accepted
    Consistent time field across settings files
    Configurable time field
    Fixed table index when results are 0 entries
    Changed kibana-dashboard to banana-dashboard in saved gist
    Fixed table indexing and re-strating offset after changing dashboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants