Merge pull request #37 from fenix-hub/dev

Dev
This commit is contained in:
Nicolò Santilio 2021-01-08 21:04:59 +01:00 committed by GitHub
commit bbc4756327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 13 deletions

View File

@ -12,6 +12,7 @@ Author: *"Nicolo (fenix) Santilio"*
Version: *0.5.3*
Wiki: *[wip](https://github.com/fenix-hub/godot-engine.easy-charts/wiki)*
Godot Version: *3.2stable*
## What is this?
*Easy Charts* is a collection of Control, 2D and 3D nodes to plot charts.
This plugin was born from the personal necessity to plot some charts and tables for my university degree project.
@ -22,25 +23,30 @@ If you need to plot a chart with some values in it and just take a screenshot, o
[*Startup Company*](https://store.steampowered.com/app/606800/Startup_Company/)
![wa](imgs/workplace_analytics.png)
[*Microsoft Workplace Analytics*](https://www.microsoft.com/microsoft-365/partners/workplaceanalytics)
## How does it work?
There is a [WIKI](https://github.com/fenix-hub/godot-engine.easy-charts/wiki) with some tutorials, even if it is a work in progress.
I'll make some videos as soon as possible.
# Available Charts and when to use them
This library offers a set of charts for each main Godot Node:
- **Control Nodes:** "Control Charts" are fast Charts that can be plotted in a Control space, such as UIs or Control user interactable areas. They offer basic Control properties, such as Margins, size inheritance and control. No animations, no real time changes, just charts.
- **2D Nodes:** "2D Charts" are a set of Charts which can be Used in 2D spaces. They offer additional tools, such as animations and real time changes in editor. They can be used to implement more aesthetic charts in 2D contexts.
- **[wip] 3D Nodes:** "3D Charts" are a set of Charts which can be Used in both 2D and 3D spaces. They offer the possibility to plot 3D datasets, which are common in machine learning contexts or just data analysis. A Camera Control will also be available, which can be used to move around the chart.
### Available Charts
- LineChart [Control, 2D, wip 3D]
- ColumnChart [Control, 2D, wipr 3D]
- ScatterChart [wip Control, wip 2D, 3D]
- Piechart [Control]
- RadarChart [Control]
### WIP Charts
- Area Chart
- Donut Chart
- Bubble Chart
- Parliament Chart
### Some Examples
![example_LineChart_realtime](imgs/real_time_line.gif)
![example_Piechart](imgs/pie_chart_realtime.gif)
@ -48,10 +54,12 @@ This library offers a set of charts for each main Godot Node:
![example01](imgs/scatter.gif)
![example02](imgs/example02.png)
![example03](imgs/example03.gif)
##### Some references for charts and plots
[Flourish](https://app.flourish.studio/projects)
[Chart.js](https://www.chartjs.org/samples/latest/)
[Google Charts](https://developers.google.com/chart)
# Disclaimer
This addon was built for a **personal use** intention. It was released as an open source plugin in the hope that it could be useful to the Godot Engine Community.
As a "work in progress" project, there is *no warranty* for any eventual issue and bug that may broke your project.

View File

@ -6,6 +6,7 @@
[node name="PieChart" type="Control"]
anchor_right = 1.0
anchor_bottom = 0.993333
mouse_filter = 1
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": true
@ -24,10 +25,12 @@ Chart_Modifiers/rotation = 0.0
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 1
[node name="Points" type="Control" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 1
__meta__ = {
"_edit_use_anchors_": false
}
@ -44,6 +47,7 @@ __meta__ = {
use_parent_material = true
anchor_right = 1.0
anchor_bottom = 0.0233333
mouse_filter = 1
align = 1
valign = 1
__meta__ = {
@ -53,9 +57,9 @@ __meta__ = {
[node name="PointData" parent="." instance=ExtResource( 2 )]
[node name="PointData" parent="PointData" index="0"]
margin_left = -63.9924
margin_top = -129.716
margin_right = -64.0923
margin_bottom = -128.916
margin_left = -375.27
margin_top = -216.457
margin_right = -375.37
margin_bottom = -215.657
[editable path="PointData"]

View File

@ -210,10 +210,10 @@ func _draw_areas():
var mouse_on_area : int
var mouse_on_slice : bool = false
func _input(event):
func _gui_input(event : InputEvent):
if event is InputEventMouseMotion:
for area_idx in range(areas.size()):
if Geometry.is_point_in_polygon(event.global_position - rect_position, areas[area_idx]):
if Geometry.is_point_in_polygon(event.global_position - get_global_transform().origin, areas[area_idx]):
mouse_on_slice = true
mouse_on_area = area_idx
show_slice_data(slices[area_idx])