restructure folder

This commit is contained in:
fenix-hub 2022-01-08 16:34:36 +01:00
parent bbfe1c4783
commit e3a78ed60a
24 changed files with 56 additions and 42 deletions

View File

@ -93,7 +93,7 @@ func plot():
PointData.hide() PointData.hide()
if source == "" or source == null: if source == "" or source == null:
Utilities._print_message("Can't plot a chart without a Source file. Please, choose it in editor, or use the custom function _plot().",1) ECECUtilities._print_message("Can't plot a chart without a Source file. Please, choose it in editor, or use the custom function _plot().",1)
return return
datas = read_datas(source,delimiter) datas = read_datas(source,delimiter)
count_functions() count_functions()
@ -448,7 +448,7 @@ func create_legend():
func apply_template(template_name : int): func apply_template(template_name : int):
template = template_name template = template_name
templates = Utilities._load_templates() templates = ECECUtilities._load_templates()
if template_name!=null: if template_name!=null:
var custom_template = templates.get(templates.keys()[template_name]) var custom_template = templates.get(templates.keys()[template_name])
function_colors = custom_template.function_colors as PoolColorArray function_colors = custom_template.function_colors as PoolColorArray

View File

@ -1,12 +1,13 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/easy_charts/ColumnChart2D/column_chart2D.gd" type="Script" id=1] [ext_resource path="res://addons/easy_charts/2DChart/ColumnChart2D/column_chart2D.gd" type="Script" id=1]
[ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=2] [ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=2]
[node name="BarChart2D" type="Node2D"] [node name="BarChart2D" type="Node2D"]
script = ExtResource( 1 ) script = ExtResource( 1 )
__meta__ = { __meta__ = {

View File

@ -89,7 +89,7 @@ func plot():
PointData.hide() PointData.hide()
if source == "" or source == null: if source == "" or source == null:
Utilities._print_message("Can't plot a chart without a Source file. Please, choose it in editor, or use the custom function _plot().", 1) ECUtilities._print_message("Can't plot a chart without a Source file. Please, choose it in editor, or use the custom function _plot().", 1)
return return
datas = read_datas(source,delimiter) datas = read_datas(source,delimiter)
count_functions() count_functions()

View File

@ -1,11 +1,12 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/easy_charts/LineChart2D/line_chart2D.gd" type="Script" id=1] [ext_resource path="res://addons/easy_charts/2DChart/LineChart2D/line_chart2D.gd" type="Script" id=1]
[ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=2] [ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=2]
[node name="LineChart2D" type="Node2D"] [node name="LineChart2D" type="Node2D"]
position = Vector2( -1, 0 ) position = Vector2( -1, 0 )
script = ExtResource( 1 ) script = ExtResource( 1 )

View File

@ -92,7 +92,7 @@ func plot():
PointData.hide() PointData.hide()
if source == "" or source == null: if source == "" or source == null:
Utilities._print_message("Can't plot a chart without a Source file. Please, choose it in editor, or use the custom function _plot().",1) ECUtilities._print_message("Can't plot a chart without a Source file. Please, choose it in editor, or use the custom function _plot().",1)
return return
datas = read_datas(source,delimiter) datas = read_datas(source,delimiter)
count_functions() count_functions()
@ -427,7 +427,7 @@ func create_legend():
func apply_template(template_name : int): func apply_template(template_name : int):
template = template_name template = template_name
templates = Utilities._load_templates() templates = ECUtilities._load_templates()
if template_name!=null: if template_name!=null:
var custom_template = templates.get(templates.keys()[template_name]) var custom_template = templates.get(templates.keys()[template_name])
function_colors = custom_template.function_colors as PoolColorArray function_colors = custom_template.function_colors as PoolColorArray

View File

@ -1,10 +1,11 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/easy_charts/ScatterChart2D/scatter_chart2D.gd" type="Script" id=1] [ext_resource path="res://addons/easy_charts/2DChart/ScatterChart2D/scatter_chart2D.gd" type="Script" id=1]
[ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=2] [ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=2]
[node name="ScatterChart2D" type="Node2D"] [node name="ScatterChart2D" type="Node2D"]
script = ExtResource( 1 ) script = ExtResource( 1 )
__meta__ = { __meta__ = {

View File

@ -167,7 +167,7 @@ func plot():
PointData.hide() PointData.hide()
if source == "" or source == null: if source == "" or source == null:
Utilities._print_message("Can't plot a chart without a Source file. Please, choose it in editor, or use the custom function _plot().",1) ECUtilities._print_message("Can't plot a chart without a Source file. Please, choose it in editor, or use the custom function _plot().",1)
return return
datas = read_datas(source,delimiter) datas = read_datas(source,delimiter)
# count_functions() # count_functions()
@ -295,7 +295,7 @@ func get_legend():
func apply_template(template_name : String): func apply_template(template_name : String):
template = template_name template = template_name
templates = Utilities._load_templates() templates = ECUtilities._load_templates()
if template_name!=null and template_name!="": if template_name!=null and template_name!="":
var custom_template = templates[template.to_lower()] var custom_template = templates[template.to_lower()]
function_colors = custom_template.function_colors function_colors = custom_template.function_colors

View File

@ -1,10 +1,11 @@
[gd_scene load_steps=7 format=2] [gd_scene load_steps=7 format=2]
[ext_resource path="res://addons/easy_charts/ScatterChart3D/scatter_chart3D.gd" type="Script" id=1] [ext_resource path="res://addons/easy_charts/3DChart/ScatterChart3D/scatter_chart3D.gd" type="Script" id=1]
[ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=2] [ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=2]
[sub_resource type="SpatialMaterial" id=1] [sub_resource type="SpatialMaterial" id=1]
flags_unshaded = true flags_unshaded = true

View File

@ -141,7 +141,7 @@ func _get_property_list():
}, },
{ {
"hint": PROPERTY_HINT_ENUM, "hint": PROPERTY_HINT_ENUM,
"hint_string": PoolStringArray(Utilities.templates.keys()).join(","), "hint_string": PoolStringArray(ECUtilities.templates.keys()).join(","),
"usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
"name": "Chart_Style/template", "name": "Chart_Style/template",
"type": TYPE_INT "type": TYPE_INT

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=4 format=2] [gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/easy_charts/ColumnChart/column_chart.gd" type="Script" id=2] [ext_resource path="res://addons/easy_charts/ControlChart/ColumnChart/column_chart.gd" type="Script" id=2]
[sub_resource type="Theme" id=1] [sub_resource type="Theme" id=1]

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=4 format=2] [gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/easy_charts/LineChart/line_chart.gd" type="Script" id=4] [ext_resource path="res://addons/easy_charts/ControlChart/LineChart/line_chart.gd" type="Script" id=4]
[sub_resource type="Theme" id=1] [sub_resource type="Theme" id=1]

View File

@ -68,7 +68,7 @@ func _get_property_list():
}, },
{ {
"hint": PROPERTY_HINT_ENUM, "hint": PROPERTY_HINT_ENUM,
"hint_string": PoolStringArray(Utilities.templates.keys()).join(","), "hint_string": PoolStringArray(ECUtilities.templates.keys()).join(","),
"usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
"name": "Chart_Style/template", "name": "Chart_Style/template",
"type": TYPE_INT "type": TYPE_INT

View File

@ -1,9 +1,10 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/easy_charts/PieChart/pie_chart.gd" type="Script" id=1] [ext_resource path="res://addons/easy_charts/ControlChart/PieChart/pie_chart.gd" type="Script" id=1]
[ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=2] [ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=2]
[node name="PieChart" type="Control"] [node name="PieChart" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 0.993333 anchor_bottom = 0.993333

View File

@ -111,7 +111,7 @@ func _get_property_list():
}, },
{ {
"hint": PROPERTY_HINT_ENUM, "hint": PROPERTY_HINT_ENUM,
"hint_string": PoolStringArray(Utilities.templates.keys()).join(","), "hint_string": PoolStringArray(ECUtilities.templates.keys()).join(","),
"usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
"name": "Chart_Style/template", "name": "Chart_Style/template",
"type": TYPE_INT "type": TYPE_INT

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=4 format=2] [gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/easy_charts/RadarChart/radar_chart.gd" type="Script" id=2] [ext_resource path="res://addons/easy_charts/ControlChart/RadarChart/radar_chart.gd" type="Script" id=2]
[sub_resource type="Theme" id=1] [sub_resource type="Theme" id=1]

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=4 format=2] [gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/easy_charts/Utilities/Point/point_data.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/easy_charts/ScatterChart/scatter_chart.gd" type="Script" id=2] [ext_resource path="res://addons/easy_charts/ControlChart/ScatterChart/scatter_chart.gd" type="Script" id=2]
[sub_resource type="Theme" id=1] [sub_resource type="Theme" id=1]

View File

@ -138,7 +138,7 @@ var label_displacement : int = 4 setget set_label_displacement # Separation betw
# !! API v2 # !! API v2
static func instance(chart_type : int): static func instance(chart_type : int):
var chart_t : String = Utilities.get_chart_type(chart_type) var chart_t : String = ECUtilities.get_chart_type(chart_type)
var chart : String = "res://addons/easy_charts/%s/%s.tscn" % [chart_t, chart_t] var chart : String = "res://addons/easy_charts/%s/%s.tscn" % [chart_t, chart_t]
return load(chart).instance() return load(chart).instance()
@ -326,7 +326,7 @@ func plot():
PointData.hide() PointData.hide()
if source == "" or source == null: if source == "" or source == null:
Utilities._print_message("Can't plot a chart without a Source file. Please, choose it in editor, or use the custom function _plot().",1) ECUtilities._print_message("Can't plot a chart without a Source file. Please, choose it in editor, or use the custom function _plot().",1)
return return
@ -348,7 +348,7 @@ func plot_from_csv(csv_file : String, _delimiter : String = delimiter):
PointData.hide() PointData.hide()
if csv_file == "" or csv_file == null: if csv_file == "" or csv_file == null:
Utilities._print_message("Can't plot a chart without a Source file. Please, choose it in editor, or use the custom function _plot().",1) ECUtilities._print_message("Can't plot a chart without a Source file. Please, choose it in editor, or use the custom function _plot().",1)
return return
data = read_datas(csv_file, _delimiter) data = read_datas(csv_file, _delimiter)
@ -369,7 +369,7 @@ func plot_from_array(array : Array) -> void:
PointData.hide() PointData.hide()
if array.empty(): if array.empty():
Utilities._print_message("Can't plot a chart with an empty Array.",1) ECUtilities._print_message("Can't plot a chart with an empty Array.",1)
return return
data = array.duplicate(true) data = array.duplicate(true)
@ -394,7 +394,7 @@ func plot_from_dataframe(dataframe : DataFrame) -> void:
data = dataframe.get_dataframe().duplicate(true) data = dataframe.get_dataframe().duplicate(true)
if data.empty(): if data.empty():
Utilities._print_message("Can't plot a chart with an empty Array.",1) ECUtilities._print_message("Can't plot a chart with an empty Array.",1)
return return
structure_datas(slice_data()) structure_datas(slice_data())
@ -413,7 +413,7 @@ func plot_from_dataframe(dataframe : DataFrame) -> void:
# All data are stored. # All data are stored.
func update_plot_data(array : Array) -> void: func update_plot_data(array : Array) -> void:
if array.empty(): if array.empty():
Utilities._print_message("Can't plot a chart with an empty Array.",1) ECUtilities._print_message("Can't plot a chart with an empty Array.",1)
return return
data.append(array) data.append(array)
@ -430,7 +430,7 @@ func update_plot_data(array : Array) -> void:
# Append a new column to data # Append a new column to data
func append_new_column(dataset : Array, column : Array): func append_new_column(dataset : Array, column : Array):
if column.empty(): if column.empty():
Utilities._print_message("Can't update plot with an empty row.",1) ECUtilities._print_message("Can't update plot with an empty row.",1)
return return
for value_idx in column.size(): for value_idx in column.size():
dataset[value_idx].append(column[value_idx]) dataset[value_idx].append(column[value_idx])
@ -683,7 +683,7 @@ func set_template(template_name : int):
if not use_template: return if not use_template: return
template = template_name template = template_name
if template_name!=null: if template_name!=null:
var custom_template = Utilities.templates.get(Utilities.templates.keys()[template_name]) var custom_template = ECUtilities.templates.get(ECUtilities.templates.keys()[template_name])
function_colors = custom_template.function_colors as PoolColorArray function_colors = custom_template.function_colors as PoolColorArray
outline_color = Color(custom_template.outline_color) outline_color = Color(custom_template.outline_color)
box_color = Color(custom_template.outline_color) box_color = Color(custom_template.outline_color)

View File

@ -135,7 +135,7 @@ func _get_children():
func apply_template(template_name: int): func apply_template(template_name: int):
template = template_name template = template_name
templates = Utilities._load_templates() templates = ECUtilities._load_templates()
if template_name != null: if template_name != null:
var custom_template = templates.get(templates.keys()[template_name]) var custom_template = templates.get(templates.keys()[template_name])
function_colors = custom_template.function_colors as PoolColorArray function_colors = custom_template.function_colors as PoolColorArray

View File

@ -201,7 +201,7 @@ func build_property_list():
property_list.append( property_list.append(
{ {
"hint": PROPERTY_HINT_ENUM, "hint": PROPERTY_HINT_ENUM,
"hint_string": PoolStringArray(Utilities.templates.keys()).join(","), "hint_string": PoolStringArray(ECUtilities.templates.keys()).join(","),
"usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE, "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
"name": "Chart_Style/template", "name": "Chart_Style/template",
"type": TYPE_INT "type": TYPE_INT
@ -299,10 +299,10 @@ func plot_function(x:Array, y:Array, param_dic := {}):
var id := "" var id := ""
if x.empty() or y.empty(): if x.empty() or y.empty():
Utilities._print_message("Can't plot a chart with an empty Array.",1) ECUtilities._print_message("Can't plot a chart with an empty Array.",1)
return return
elif x.size() != y.size(): elif x.size() != y.size():
Utilities._print_message("Can't plot a chart with x and y having different number of elements.",1) ECUtilities._print_message("Can't plot a chart with x and y having different number of elements.",1)
return return
for param in param_dic.keys(): for param in param_dic.keys():
@ -318,7 +318,7 @@ func plot_function(x:Array, y:Array, param_dic := {}):
id = generate_identifier() if id.empty() else id id = generate_identifier() if id.empty() else id
if y_labels.has(id): if y_labels.has(id):
Utilities._print_message("The identifier %s is already used. Please use a different one." % id,1) ECUtilities._print_message("The identifier %s is already used. Please use a different one." % id,1)
return return
y_domain[0].append(null) y_domain[0].append(null)
@ -338,7 +338,7 @@ func update_function(id:String, x:Array, y:Array, param_dic := {}):
var function = y_labels.find(id) var function = y_labels.find(id)
if function == -1: #Not found if function == -1: #Not found
Utilities._print_message("The identifier %s does not exist." % id,1) ECUtilities._print_message("The identifier %s does not exist." % id,1)
return return
for param in param_dic.keys(): for param in param_dic.keys():
@ -360,7 +360,7 @@ func delete_function(id:String):
var function = y_labels.find(id) var function = y_labels.find(id)
if function == -1: #Not found if function == -1: #Not found
Utilities._print_message("The identifier %s does not exist." % id,1) ECUtilities._print_message("The identifier %s does not exist." % id,1)
return return
y_labels.remove(function) y_labels.remove(function)

View File

@ -2,15 +2,15 @@
importer="texture" importer="texture"
type="StreamTexture" type="StreamTexture"
path="res://.import/linechart.svg-1b22ec0a8537b638d716ea5c462d4141.stex" path="res://.import/linechart.svg-922834f0462a2c88be644081c47c63ad.stex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://addons/easy_charts/Utilities/icons/linechart.svg" source_file="res://addons/easy_charts/utilities/icons/linechart.svg"
dest_files=[ "res://.import/linechart.svg-1b22ec0a8537b638d716ea5c462d4141.stex" ] dest_files=[ "res://.import/linechart.svg-922834f0462a2c88be644081c47c63ad.stex" ]
[params] [params]
@ -28,6 +28,7 @@ process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/HDR_as_SRGB=false process/HDR_as_SRGB=false
process/invert_color=false process/invert_color=false
process/normal_map_invert_y=false
stream=false stream=false
size_limit=0 size_limit=0
detect_3d=false detect_3d=false

View File

@ -2,15 +2,15 @@
importer="texture" importer="texture"
type="StreamTexture" type="StreamTexture"
path="res://.import/linechart2d.svg-af92a4d6767d218934fb7a6905401722.stex" path="res://.import/linechart2d.svg-1067b05eddcc451c2fc80a8734aa8056.stex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://addons/easy_charts/Utilities/icons/linechart2d.svg" source_file="res://addons/easy_charts/utilities/icons/linechart2d.svg"
dest_files=[ "res://.import/linechart2d.svg-af92a4d6767d218934fb7a6905401722.stex" ] dest_files=[ "res://.import/linechart2d.svg-1067b05eddcc451c2fc80a8734aa8056.stex" ]
[params] [params]
@ -28,6 +28,7 @@ process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/HDR_as_SRGB=false process/HDR_as_SRGB=false
process/invert_color=false process/invert_color=false
process/normal_map_invert_y=false
stream=false stream=false
size_limit=0 size_limit=0
detect_3d=true detect_3d=true

View File

@ -1,10 +1,13 @@
[remap] [remap]
importer="csv" importer="csv_translation"
type="TextFile" type="Translation"
valid=false
[deps] [deps]
source_file="res://addons/easy_charts/file.samples/linechart (columns).csv" source_file="res://addons/easy_charts/file.samples/linechart (columns).csv"
[params] [params]
compress=true
delimiter=0