diff --git a/.gitignore b/.gitignore index 5ea1783..0c60b9e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,20 @@ .import/ export.cfg export_presets.cfg - # Imported translations (automatically generated from CSV files) *.translation - +# Plugin specific ignores +.github/ +file-editor/ +scn/ +default_env.tres +icon.png +icon.png.import +project.godot # Mono-specific ignores .mono/ data_*/ mono_crash.*.json - # System/tool-specific ignores .directory *~ diff --git a/addons/easy_charts/BarChart2D/LineChart2D.tscn.depren b/addons/easy_charts/BarChart2D/LineChart2D.tscn.depren deleted file mode 100644 index aa35599..0000000 --- a/addons/easy_charts/BarChart2D/LineChart2D.tscn.depren +++ /dev/null @@ -1,108 +0,0 @@ -[gd_scene load_steps=4 format=2] - -[ext_resource path="res://addons/easy_charts/LineChart2D/LineChart2D.gd" type="Script" id=1] -[ext_resource path="res://addons/easy_charts/Utilities/Point/PointData.gd" type="Script" id=3] - - - - -[sub_resource type="StyleBoxFlat" id=1] -content_margin_left = 8.0 -content_margin_right = 8.0 -content_margin_top = 5.0 -content_margin_bottom = 5.0 -bg_color = Color( 1, 1, 1, 0 ) -border_width_left = 2 -border_width_top = 2 -border_width_right = 2 -border_width_bottom = 2 -border_color = Color( 1, 1, 1, 1 ) -corner_radius_top_left = 5 -corner_radius_top_right = 5 -corner_radius_bottom_right = 5 -corner_radius_bottom_left = 5 -corner_detail = 20 - -[node name="LineChart2D" type="Node2D"] -script = ExtResource( 1 ) -drawing_duration = 0.3 -font_color = Color( 0.137255, 0.137255, 0.137255, 1 ) - -[node name="Grid" type="Node2D" parent="."] - -[node name="VLine" type="Line2D" parent="Grid"] -points = PoolVector2Array( 0, 0, 0, 0 ) -width = 1.0 -default_color = Color( 0.792157, 0.792157, 0.792157, 1 ) - -[node name="HLine" type="Line2D" parent="Grid"] -points = PoolVector2Array( 0, 0, 0, 0 ) -width = 1.0 -default_color = Color( 0.792157, 0.792157, 0.792157, 1 ) - -[node name="Outlines" type="Line2D" parent="."] -points = PoolVector2Array( 0, 0, 2, 0, 2, 2, 0, 2, 0, 0 ) -width = 2.0 -default_color = Color( 0.117647, 0.117647, 0.117647, 1 ) - -[node name="Functions" type="Node2D" parent="."] - -[node name="Function" type="Line2D" parent="Functions"] -points = PoolVector2Array( 0, 0, 0, 0 ) -width = 2.0 -default_color = Color( 0.117647, 0.117647, 0.117647, 1 ) - -[node name="FunctionsTween" type="Tween" parent="."] - -[node name="OutlinesTween" type="Tween" parent="."] - -[node name="GridTween" type="Tween" parent="."] - -[node name="UI" type="CanvasLayer" parent="."] - -[node name="PointData" type="PanelContainer" parent="UI"] -margin_right = 67.0 -margin_bottom = 38.0 -mouse_filter = 2 -custom_styles/panel = SubResource( 1 ) -script = ExtResource( 3 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="PointData" type="VBoxContainer" parent="UI/PointData"] -margin_left = 8.0 -margin_top = 5.0 -margin_right = 59.0 -margin_bottom = 36.0 -custom_constants/separation = 3 -alignment = 1 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Function" type="Label" parent="UI/PointData/PointData"] -margin_right = 51.0 -margin_bottom = 14.0 -align = 1 -valign = 1 - -[node name="Value" type="HBoxContainer" parent="UI/PointData/PointData"] -margin_top = 17.0 -margin_right = 51.0 -margin_bottom = 31.0 - -[node name="x" type="Label" parent="UI/PointData/PointData/Value"] -margin_right = 39.0 -margin_bottom = 14.0 -custom_colors/font_color = Color( 1, 1, 1, 1 ) -text = "Value:" -valign = 1 - -[node name="y" type="Label" parent="UI/PointData/PointData/Value"] -margin_left = 43.0 -margin_right = 51.0 -margin_bottom = 14.0 -custom_colors/font_color = Color( 1, 1, 1, 1 ) -text = "0" -valign = 1 diff --git a/addons/easy_charts/LineChart2D/LineChart2D.tscn.depren b/addons/easy_charts/LineChart2D/LineChart2D.tscn.depren deleted file mode 100644 index aa35599..0000000 --- a/addons/easy_charts/LineChart2D/LineChart2D.tscn.depren +++ /dev/null @@ -1,108 +0,0 @@ -[gd_scene load_steps=4 format=2] - -[ext_resource path="res://addons/easy_charts/LineChart2D/LineChart2D.gd" type="Script" id=1] -[ext_resource path="res://addons/easy_charts/Utilities/Point/PointData.gd" type="Script" id=3] - - - - -[sub_resource type="StyleBoxFlat" id=1] -content_margin_left = 8.0 -content_margin_right = 8.0 -content_margin_top = 5.0 -content_margin_bottom = 5.0 -bg_color = Color( 1, 1, 1, 0 ) -border_width_left = 2 -border_width_top = 2 -border_width_right = 2 -border_width_bottom = 2 -border_color = Color( 1, 1, 1, 1 ) -corner_radius_top_left = 5 -corner_radius_top_right = 5 -corner_radius_bottom_right = 5 -corner_radius_bottom_left = 5 -corner_detail = 20 - -[node name="LineChart2D" type="Node2D"] -script = ExtResource( 1 ) -drawing_duration = 0.3 -font_color = Color( 0.137255, 0.137255, 0.137255, 1 ) - -[node name="Grid" type="Node2D" parent="."] - -[node name="VLine" type="Line2D" parent="Grid"] -points = PoolVector2Array( 0, 0, 0, 0 ) -width = 1.0 -default_color = Color( 0.792157, 0.792157, 0.792157, 1 ) - -[node name="HLine" type="Line2D" parent="Grid"] -points = PoolVector2Array( 0, 0, 0, 0 ) -width = 1.0 -default_color = Color( 0.792157, 0.792157, 0.792157, 1 ) - -[node name="Outlines" type="Line2D" parent="."] -points = PoolVector2Array( 0, 0, 2, 0, 2, 2, 0, 2, 0, 0 ) -width = 2.0 -default_color = Color( 0.117647, 0.117647, 0.117647, 1 ) - -[node name="Functions" type="Node2D" parent="."] - -[node name="Function" type="Line2D" parent="Functions"] -points = PoolVector2Array( 0, 0, 0, 0 ) -width = 2.0 -default_color = Color( 0.117647, 0.117647, 0.117647, 1 ) - -[node name="FunctionsTween" type="Tween" parent="."] - -[node name="OutlinesTween" type="Tween" parent="."] - -[node name="GridTween" type="Tween" parent="."] - -[node name="UI" type="CanvasLayer" parent="."] - -[node name="PointData" type="PanelContainer" parent="UI"] -margin_right = 67.0 -margin_bottom = 38.0 -mouse_filter = 2 -custom_styles/panel = SubResource( 1 ) -script = ExtResource( 3 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="PointData" type="VBoxContainer" parent="UI/PointData"] -margin_left = 8.0 -margin_top = 5.0 -margin_right = 59.0 -margin_bottom = 36.0 -custom_constants/separation = 3 -alignment = 1 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Function" type="Label" parent="UI/PointData/PointData"] -margin_right = 51.0 -margin_bottom = 14.0 -align = 1 -valign = 1 - -[node name="Value" type="HBoxContainer" parent="UI/PointData/PointData"] -margin_top = 17.0 -margin_right = 51.0 -margin_bottom = 31.0 - -[node name="x" type="Label" parent="UI/PointData/PointData/Value"] -margin_right = 39.0 -margin_bottom = 14.0 -custom_colors/font_color = Color( 1, 1, 1, 1 ) -text = "Value:" -valign = 1 - -[node name="y" type="Label" parent="UI/PointData/PointData/Value"] -margin_left = 43.0 -margin_right = 51.0 -margin_bottom = 14.0 -custom_colors/font_color = Color( 1, 1, 1, 1 ) -text = "0" -valign = 1 diff --git a/addons/easy_charts/RadarChart/RadarChart.gd b/addons/easy_charts/RadarChart/RadarChart.gd deleted file mode 100644 index 7bec9cb..0000000 --- a/addons/easy_charts/RadarChart/RadarChart.gd +++ /dev/null @@ -1,280 +0,0 @@ -tool -extends Chart -class_name RadarChart - -""" -[RadarChart] - General purpose node for Radar Charts -A radar chart is a graphical method of displaying multivariate data in the form -of a two-dimensional chart of three or more quantitative variables represented on axes -starting from the same point. The relative position and angle of the axes is typically -uninformative, but various heuristics, such as algorithms that plot data as the maximal -total area, can be applied to sort the variables (axes) into relative positions that reveal -distinct correlations, trade-offs, and a multitude of other comparative measures. - -/ source : Wikipedia / -""" - -func _get_property_list(): - return [ - # Chart Properties - { - "hint": PROPERTY_HINT_NONE, - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, - "name": "Chart_Properties/are_values_columns", - "type": TYPE_BOOL - }, - { - "hint": PROPERTY_HINT_RANGE, - "hint_string": "-1,100,1", - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, - "name": "Chart_Properties/labels_index", - "type": TYPE_INT - }, - { - "hint": PROPERTY_HINT_RANGE, - "hint_string": "-1,100,1", - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, - "name": "Chart_Properties/function_names_index", - "type": TYPE_INT - }, - { - "hint": PROPERTY_HINT_NONE, - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, - "name": "Chart_Properties/use_height_as_radius", - "type": TYPE_BOOL - }, - { - "hint": PROPERTY_HINT_RANGE, - "hint_string": "0,2000", - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, - "name": "Chart_Properties/radius", - "type": TYPE_REAL - }, - - # Chart Display - { - "hint": PROPERTY_HINT_RANGE, - "hint_string": "0.1,100", - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, - "name": "Chart_Display/full_scale", - "type": TYPE_REAL - }, - - # Chart Style - { - "hint": 24, - "hint_string": "%d/%d:%s"%[TYPE_INT, PROPERTY_HINT_ENUM, - PoolStringArray(PointShapes.keys()).join(",")], - "name": "Chart_Style/points_shape", - "type": TYPE_ARRAY, - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE - }, - { - "hint": PROPERTY_HINT_NONE, - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, - "name": "Chart_Style/function_colors", - "type": TYPE_COLOR_ARRAY - }, - { - "hint": PROPERTY_HINT_NONE, - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, - "name": "Chart_Style/outline_color", - "type": TYPE_COLOR - }, - { - "hint": PROPERTY_HINT_NONE, - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, - "name": "Chart_Style/grid_color", - "type": TYPE_COLOR - }, - { - "class_name": "Font", - "hint": PROPERTY_HINT_RESOURCE_TYPE, - "hint_string": "Font", - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, - "name": "Chart_Style/font", - "type": TYPE_OBJECT - }, - { - "class_name": "Font", - "hint": PROPERTY_HINT_RESOURCE_TYPE, - "hint_string": "Font", - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, - "name": "Chart_Style/bold_font", - "type": TYPE_OBJECT - }, - { - "hint": PROPERTY_HINT_NONE, - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, - "name": "Chart_Style/font_color", - "type": TYPE_COLOR - }, - { - "hint": PROPERTY_HINT_ENUM, - "hint_string": PoolStringArray(TemplatesNames.keys()).join(","), - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, - "name": "Chart_Style/template", - "type": TYPE_INT - }, - { - "hint": PROPERTY_HINT_RANGE, - "hint_string": "0,360", - "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, - "name": "Chart_Modifiers/rotation", - "type": TYPE_REAL - }, - ] - -func structure_datas(database : Array, are_values_columns : bool, labels_index : int): - # @x_values_index can be either a column or a row relative to x values - # @y_values can be either a column or a row relative to y values - self.labels_index = labels_index - self.are_values_columns = are_values_columns - match are_values_columns: - true: - for row in database.size(): - if row == labels_index: - x_labels = database[row] as PoolStringArray - else: - if database[row].empty() or database[row].size() < 2: - continue - x_datas.append(PoolRealArray(database[row] as Array)) - - for column in database[row].size(): - if column == function_names_index: - y_labels.append(database[row][column]) - false: - for row in database.size(): - if row == function_names_index: - y_labels = database[row] as PoolStringArray - - var x_temp_datas : PoolRealArray = [] - for column in database[row].size(): - if column == labels_index: - x_labels.append(database[row][column] as String) - else: - x_temp_datas.append(database[row][column] as float) - x_datas.append(x_temp_datas) - - if labels_index == -1 : - for data in x_datas[0].size(): - x_labels.append("Element %s" % data) - - if function_names_index == -1 : - for data in x_datas.size(): - y_labels.append("Function %s" % data) - -func build_chart(): - SIZE = get_size() - origin = OFFSET + SIZE/2 - -var radar_polygon : Array - -func calculate_pass() : - var ordered_max : Array - for data in x_datas : - var ordered_data : Array = (data as Array) - ordered_data.sort() - ordered_max.append(ordered_data.pop_back()) - ordered_max.sort() - var max_value : float = ordered_max.pop_back() - var dist = full_scale * pow(10.0,str(max_value).length()-2) - var multi = 0 - var value = dist * multi - x_chors.append(value as String) - while value < max_value: - multi+=1 - value = dist * multi - x_chors.append(value as String) - -func calculate_coordinates(): - for chor in x_chors.size(): - var inner_polyline : PoolVector2Array - var scalar_factor : float = (x_chors[chor] as float/x_chors.back() as float) - for function in functions: - var angle : float = ((2 * PI * function) / functions) - PI /2 + deg2rad(rotation) - var x_coordinate : float = (radius if (not use_height_as_radius and radius