dataviz.d3_views

Define data visualization related D3 views.

Copyright (C) 2021 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.

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_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.

mesh_network_viz

mesh_network_viz(request)

Render a Mesh Network visualization

Args: key (str): The key type to visualize.

Returns: TemplateResponse: The populated mesh 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) 2021 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/.