dataviz.d3_views
Define data visualization related D3 views.
Copyright (C) 2018 Gitcoin Core
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.
data_viz_helper_get_data_responses
data_viz_helper_get_data_responses(request, visual_type)
Handle visualization of the request response data based on type.
Args: visual_type (str): The visualization type.
TODO: * Reduce complexity of this method to pass McCabe complexity check.
Returns: dict: The JSON representation of the requested visual type data.
viz_spiral
viz_spiral(request, key='email_open')
Render a spiral graph visualization.
Args: key (str): The key type to visualize.
Returns: TemplateResponse: The populated spiral data visualization template.
viz_chord
viz_chord(request, key='bounties_paid')
Render a chord graph visualization.
Args: key (str): The key type to visualize.
Returns: TemplateResponse: The populated chord data visualization template.
viz_steamgraph
viz_steamgraph(request, key='open')
Render a steamgraph graph visualization.
Args: key (str): The key type to visualize.
Returns: TemplateResponse: The populated steamgraph data visualization template.
viz_heatmap
viz_heatmap(request, key='email_open', template='heatmap')
Render a heatmap graph visualization.
Args: key (str): The key type to visualize.
Returns: JsonResponse: If data param provided, return a JSON representation of data to be graphed. TemplateResponse: If data param not provided, return the populated data visualization template.
viz_index
viz_index(request)
Render the visualization index.
Returns: TemplateResponse: The visualization index template response.
viz_circles
viz_circles(request, visual_type)
Render a circle graph visualization.
Args: visual_type (str): The visualization type.
Returns: JsonResponse: If data param provided, return a JSON representation of data to be graphed. TemplateResponse: If data param not provided, return the populated data visualization template.
data_viz_helper_merge_json_trees
data_viz_helper_merge_json_trees(output)
Handle merging the visualization data trees.
Args: output (dict): The output data to be merged.
Returns: dict: The merged data dictionary.
data_viz_helper_get_json_output
data_viz_helper_get_json_output(key, value, depth=0)
Handle data visualization and build the JSON output.
Args: key (str): The key to be formatted and parsed. value (float): The data value. depth (int): The depth of keys to parse. Defaults to: 0.
Returns: dict: The JSON representation of the provided data.
viz_sunburst
viz_sunburst(request, visual_type, template='sunburst')
Render a sunburst graph visualization.
Args: visual_type (str): The visualization type. template (str): The template type to be used. Defaults to: sunburst.
TODO: * Reduce the number of local variables in this method from 18 to 15.
Returns: JsonResponse: If data param provided, return a JSON representation of data to be graphed. TemplateResponse: If data param not provided, return the populated data visualization template.
viz_graph
viz_graph(request, _type, template='graph')
Render a graph visualization of the Gitcoin Network.
TODO: * Reduce the number of local variables from 16 to 15.
Returns: JsonResponse: If data param provided, return a JSON representation of data to be graphed. TemplateResponse: If data param not provided, return the populated data visualization template.
viz_draggable
viz_draggable(request, key='email_open')
Render a draggable graph visualization.
Args: key (str): The key type to visualize.
Returns: TemplateResponse: The populated draggable data visualization template.
viz_scatterplot_helper
viz_scatterplot_helper(request, key='hourly_rate', template='dataviz/scatterplot.html', hide_usernames=False)
Render a scatterplot visualization.
Args: key (str): The key type to visualize.
Returns: TemplateResponse: The populated scatterplot data visualization template.
dataviz.views
Define data visualization related administration views.
Copyright (C) 2018 Gitcoin Core
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.