From e2651f2fce43453a730e0eba33ffde3cd939e0d4 Mon Sep 17 00:00:00 2001 From: fenix-hub Date: Sat, 8 Jan 2022 18:55:22 +0100 Subject: [PATCH] finish 1st refactoring --- README.md | 6 ++ .../Utilities/classes/base/chart.gd | 10 +- .../file.samples/linechart (columns).csv | 10 -- .../linechart (columns).csv.import | 3 - .../file.samples/linechart (rows).csv | 10 -- .../file.samples/linechart (rows).csv.import | 10 -- addons/easy_charts/file.samples/linechart.csv | 2 - .../file.samples/linechart.csv.import | 10 -- addons/easy_charts/file.samples/pie.csv | 8 -- .../easy_charts/file.samples/pie.csv.import | 10 -- addons/easy_charts/file.samples/radar.csv | 4 - .../easy_charts/file.samples/radar.csv.import | 10 -- .../file.samples/scatter (columns).csv | 101 ------------------ .../file.samples/scatter (columns).csv.import | 10 -- .../file.samples/scatter.csv.import | 10 -- addons/easy_charts/icon.png.import | 1 + 16 files changed, 14 insertions(+), 201 deletions(-) delete mode 100644 addons/easy_charts/file.samples/linechart (columns).csv delete mode 100644 addons/easy_charts/file.samples/linechart (columns).csv.import delete mode 100644 addons/easy_charts/file.samples/linechart (rows).csv delete mode 100644 addons/easy_charts/file.samples/linechart (rows).csv.import delete mode 100644 addons/easy_charts/file.samples/linechart.csv delete mode 100644 addons/easy_charts/file.samples/linechart.csv.import delete mode 100644 addons/easy_charts/file.samples/pie.csv delete mode 100644 addons/easy_charts/file.samples/pie.csv.import delete mode 100644 addons/easy_charts/file.samples/radar.csv delete mode 100644 addons/easy_charts/file.samples/radar.csv.import delete mode 100644 addons/easy_charts/file.samples/scatter (columns).csv delete mode 100644 addons/easy_charts/file.samples/scatter (columns).csv.import delete mode 100644 addons/easy_charts/file.samples/scatter.csv.import diff --git a/README.md b/README.md index f77c436..acc7f3c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +

+ +react + +

+ # Notice, plugin under refactoring **This plugin is under refactoring an maintenance. The next official release will contain multiple updates and upgrades.**\ **If you encounter any bug, please contact me on Discord.** diff --git a/addons/easy_charts/Utilities/classes/base/chart.gd b/addons/easy_charts/Utilities/classes/base/chart.gd index ba4ab21..6c5385b 100644 --- a/addons/easy_charts/Utilities/classes/base/chart.gd +++ b/addons/easy_charts/Utilities/classes/base/chart.gd @@ -72,7 +72,7 @@ var legend : Array setget set_legend,get_legend # ................... Export Shared Variables .................. export (String) var chart_name : String = "" setget set_chart_name -export (String, FILE, "*.txt, *.csv") var source : String = "" setget set_source +export (String, FILE, "*.txt, *.csv, *.res") var source : String = "" setget set_source export (String) var delimiter : String = ";" setget set_delimiter var origin_at_zero : bool = false setget set_origin_at_zero#, get_origin_at_zero @@ -322,7 +322,7 @@ func plot(_dataset: Array = read_data(source, delimiter)) -> void: compute_display() display_plot() emit_signal("chart_plotted",self) - if not is_connected("item_rect_changed",self, "redraw"): connect("item_rect_changed", self, "redraw") + if not is_connected("item_rect_changed", self, "redraw_plot"): connect("item_rect_changed", self, "redraw_plot") func plot_from_source(file : String, _delimiter : String = delimiter) -> void: plot(read_data(file, _delimiter)) @@ -385,7 +385,7 @@ func slice_data(data: Array) -> Array: data_to_display = data.duplicate(true) return data_to_display -# .................. Display and Draw functions ....................... +# ................................. Display and Draw functions ....................... func compute_display(): count_functions() calculate_colors() @@ -397,6 +397,10 @@ func display_plot(): calculate_pass() calculate_coordinates() +func redraw_plot(): + clean_points() + display_plot() + # ................................. Helper Functions ................................. func load_font(): diff --git a/addons/easy_charts/file.samples/linechart (columns).csv b/addons/easy_charts/file.samples/linechart (columns).csv deleted file mode 100644 index 57b4e53..0000000 --- a/addons/easy_charts/file.samples/linechart (columns).csv +++ /dev/null @@ -1,10 +0,0 @@ -Year;Column 1;Column 2;Column 3;Column 4 -2009;36200;27200;26200;17200 -2010;36600;27800;26600;17800 -2011;37500;28500;27500;18500 -2012;38700;29400;28700;19400 -2013;39600;30200;29600;10200 -2014;40500;30900;20500;10900 -2015;41200;31500;21200;11500 -2016;41803;31931;21803;11931 -2017;42600;32600;22600;12600 diff --git a/addons/easy_charts/file.samples/linechart (columns).csv.import b/addons/easy_charts/file.samples/linechart (columns).csv.import deleted file mode 100644 index 8dd0c09..0000000 --- a/addons/easy_charts/file.samples/linechart (columns).csv.import +++ /dev/null @@ -1,3 +0,0 @@ -[remap] - -importer="keep" diff --git a/addons/easy_charts/file.samples/linechart (rows).csv b/addons/easy_charts/file.samples/linechart (rows).csv deleted file mode 100644 index 57b4e53..0000000 --- a/addons/easy_charts/file.samples/linechart (rows).csv +++ /dev/null @@ -1,10 +0,0 @@ -Year;Column 1;Column 2;Column 3;Column 4 -2009;36200;27200;26200;17200 -2010;36600;27800;26600;17800 -2011;37500;28500;27500;18500 -2012;38700;29400;28700;19400 -2013;39600;30200;29600;10200 -2014;40500;30900;20500;10900 -2015;41200;31500;21200;11500 -2016;41803;31931;21803;11931 -2017;42600;32600;22600;12600 diff --git a/addons/easy_charts/file.samples/linechart (rows).csv.import b/addons/easy_charts/file.samples/linechart (rows).csv.import deleted file mode 100644 index 9b1b8f7..0000000 --- a/addons/easy_charts/file.samples/linechart (rows).csv.import +++ /dev/null @@ -1,10 +0,0 @@ -[remap] - -importer="csv" -type="TextFile" - -[deps] - -source_file="res://addons/easy_charts/file.samples/linechart (rows).csv" -[params] - diff --git a/addons/easy_charts/file.samples/linechart.csv b/addons/easy_charts/file.samples/linechart.csv deleted file mode 100644 index 412e7e8..0000000 --- a/addons/easy_charts/file.samples/linechart.csv +++ /dev/null @@ -1,2 +0,0 @@ -Date; 21/03/03;21/03/2008;21/03/2010;21/03/2011;21/03/2012;21/03/2013;21/03/2014;21/03/2015;21/03/2016;21/03/2018 -Score;3;8;20;18;28;31;27;38;36;46 diff --git a/addons/easy_charts/file.samples/linechart.csv.import b/addons/easy_charts/file.samples/linechart.csv.import deleted file mode 100644 index 239c88e..0000000 --- a/addons/easy_charts/file.samples/linechart.csv.import +++ /dev/null @@ -1,10 +0,0 @@ -[remap] - -importer="csv" -type="TextFile" - -[deps] - -source_file="res://addons/easy_charts/file.samples/linechart.csv" -[params] - diff --git a/addons/easy_charts/file.samples/pie.csv b/addons/easy_charts/file.samples/pie.csv deleted file mode 100644 index cae2e3a..0000000 --- a/addons/easy_charts/file.samples/pie.csv +++ /dev/null @@ -1,8 +0,0 @@ -Country,Votes -United States,46 -Great Britain,27 -China,26 -Russia,19 -Germany,17 -Italy,34 -Sweden,83 \ No newline at end of file diff --git a/addons/easy_charts/file.samples/pie.csv.import b/addons/easy_charts/file.samples/pie.csv.import deleted file mode 100644 index 5d82515..0000000 --- a/addons/easy_charts/file.samples/pie.csv.import +++ /dev/null @@ -1,10 +0,0 @@ -[remap] - -importer="csv" -type="TextFile" - -[deps] - -source_file="res://addons/easy_charts/file.samples/pie.csv" -[params] - diff --git a/addons/easy_charts/file.samples/radar.csv b/addons/easy_charts/file.samples/radar.csv deleted file mode 100644 index db3cae2..0000000 --- a/addons/easy_charts/file.samples/radar.csv +++ /dev/null @@ -1,4 +0,0 @@ -Eating;Drinking;Running;Sleeping;Coding -30;50;40;100;95 -90;34;100;50;23 - diff --git a/addons/easy_charts/file.samples/radar.csv.import b/addons/easy_charts/file.samples/radar.csv.import deleted file mode 100644 index 467fd17..0000000 --- a/addons/easy_charts/file.samples/radar.csv.import +++ /dev/null @@ -1,10 +0,0 @@ -[remap] - -importer="csv" -type="TextFile" - -[deps] - -source_file="res://addons/easy_charts/file.samples/radar.csv" -[params] - diff --git a/addons/easy_charts/file.samples/scatter (columns).csv b/addons/easy_charts/file.samples/scatter (columns).csv deleted file mode 100644 index 8143bf9..0000000 --- a/addons/easy_charts/file.samples/scatter (columns).csv +++ /dev/null @@ -1,101 +0,0 @@ -x;y1;y2 -50,05732879;116,61234;90,55501121 -53,23295081;105,6457011;47,41275029 -47,28686102;95,61795061;36,33108959 -53,0250493;106,4552515;85,4302022 -57,10271278;111,9088163;39,80610352 -40,71992494;78,27201391;79,55208897 -55,62752569;122,7859036;94,15837791 -54,17819455;107,9817124;39,80351785 -40,8610371;107,92736;61,0663229 -54,06159551;110,0647495;93,00315399 -64,35130431;134,5556319;114,2043276 -49,29181834;88,18806126;64,89624292 -44,63823505;102,8364528;108,1982178 -58,62487836;126,0319541;78,40707574 -55,78566879;95,81224088;75,02657209 -50,76570445;94,73143882;39,96573437 -48,45339259;92,86957776;88,41618517 -49,40446173;70,21723661;9,81277488 -48,34604978;97,87616091;40,53011113 -43,62470151;103,7308337;97,10613219 -50,8877046;117,1558657;62,2681611 -52,25082012;103,3922334;79,14141328 -50,35929987;87,68936817;19,3300683 -46,42761861;90,1655428;67,73792419 -55,67926036;93,17073084;69,49147048 -61,72779383;142,8458546;106,1180608 -58,99808851;102,3529041;27,35481559 -43,6620999;77,36405233;17,70195243 -55,42639088;121,0878726;78,66148172 -58,79311097;111,8698686;49,07675763 -50,71073988;106,5406487;97,82990882 -45,57346035;104,7456111;56,17215075 -45,7981314;83,9963622;75,1982308 -46,46484131;82,94617575;77,48133444 -57,9492853;144,9994608;129,0501755 -48,3999722;72,83510082;30,43512862 -54,2097076;114,7785416;82,568834 -46,67548966;95,25014621;37,57465655 -38,21698894;88,21423442;64,99724548 -51,95614673;90,93548401;66,97933728 -51,22522594;105,1106925;101,8854666 -52,84741658;105,0503069;75,20289032 -54,78984594;109,9873973;87,19755136 -52,00296104;101,442706;89,43974496 -51,43150193;88,40178257;36,97028064 -47,40407943;89,44141735;55,03733792 -51,6749185;96,54147702;31,86655852 -40,74049925;83,85842913;79,11792988 -49,82155418;112,9093356;96,08778142 -57,57763531;115,7709369;72,19330159 -51,49652924;127,9054098;118,4088806 -53,10710725;112,6337002;90,52659295 -42,93645994;102,8111834;102,8747235 -44,14066275;78,88897631;41,74831356 -46,60936983;98,64046333;54,0310935 -47,41415307;95,89594769;58,48179462 -47,99032677;106,3655192;102,3751924 -50,68360992;106,9507457;44,26713578 -50,57070899;83,19613908;61,62543009 -57,14992785;115,5596634;40,40973555 -50,45105658;97,6950217;64,24396512 -46,76779029;99,20006513;60,43227484 -50,49802495;99,43092076;87,93289581 -51,52523583;84,24653091;17,72129508 -40,72692657;102,1715902;67,44466363 -54,96034411;111,5346596;82,57431549 -48,86213774;101,4305303;58,56839256 -52,76166432;108,021472;60,25980768 -55,46249302;83,51709356;51,05460054 -51,78186354;79,45870906;11,67684552 -54,7256505;108,6386184;58,9129679 -55,03288163;112,1224042;72,08952257 -52,83806054;104,53718;101,6991195 -45,86692682;91,39643691;29,52951009 -49,67284006;110,1908352;88,51799514 -53,18552185;119,0135337;113,8280119 -41,69070011;62,78988486;53,09918475 -53,36320564;118,5841731;108,2209675 -44,27369117;74,58882658;69,31513541 -49,92198979;76,93363417;52,01164438 -44,91221355;82,33766098;44,42544743 -37,92316535;68,0076039;17,08443855 -50,10889447;103,6209931;49,51209863 -44,20348231;84,19989748;57,99641517 -57,11433271;102,0528226;84,93848989 -41,90764861;109,1360517;50,22840309 -51,88278094;89,01870776;69,13592682 -44,31355843;81,19982464;76,88626621 -44,25547817;72,64564157;53,3901634 -48,93179315;107,7773458;40,84555265 -39,36849865;59,39799005;68,0294914 -53,33338181;99,04871654;92,71533473 -61,63696872;129,3884947;76,75152598 -46,40148646;102,9511032;92,54961674 -43,81949012;75,15673812;44,337248 -53,78046359;85,87008695;50,08962336 -41,27977392;60,49700348;50,21722956 -52,32206122;106,8462547;57,52419348 -41,36660384;105,0465099;78,67990606 -47,62423286;96,62455823;84,00032537 diff --git a/addons/easy_charts/file.samples/scatter (columns).csv.import b/addons/easy_charts/file.samples/scatter (columns).csv.import deleted file mode 100644 index 997c493..0000000 --- a/addons/easy_charts/file.samples/scatter (columns).csv.import +++ /dev/null @@ -1,10 +0,0 @@ -[remap] - -importer="csv" -type="TextFile" - -[deps] - -source_file="res://addons/easy_charts/file.samples/scatter (columns).csv" -[params] - diff --git a/addons/easy_charts/file.samples/scatter.csv.import b/addons/easy_charts/file.samples/scatter.csv.import deleted file mode 100644 index cc304f9..0000000 --- a/addons/easy_charts/file.samples/scatter.csv.import +++ /dev/null @@ -1,10 +0,0 @@ -[remap] - -importer="csv" -type="TextFile" - -[deps] - -source_file="res://addons/easy_charts/file.samples/scatter.csv" -[params] - diff --git a/addons/easy_charts/icon.png.import b/addons/easy_charts/icon.png.import index 8143974..2b03f03 100644 --- a/addons/easy_charts/icon.png.import +++ b/addons/easy_charts/icon.png.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true