Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lukanedimovic/table_editor

A simple table data editor, with easily scalable functions and operations & a nice GUI
https://github.com/lukanedimovic/table_editor

data data-science formula java parser parsing preprocessing spring tokenizer

Last synced: 20 days ago
JSON representation

A simple table data editor, with easily scalable functions and operations & a nice GUI

Awesome Lists containing this project

README

        

📝 Table Editor

Table Editor is an easily scalable strongly typed editor for tabular data, supporting custom easy-to-add functions and operations and an extensible custom written parser, followed by a neat and intuitive GUI.

Date of creation: May, 2024.

Here for the updates? Check them out down below @ 🔥 Latest Modifications

🚀 Quick Start


Table Editor can be compiled and ran using provided gradlew:

git clone https://github.com/LukaNedimovic/table_editor.git
cd table_editor
./gradlew compileJava run

🛠️ Basic Features




  1. Data Types

    1. DTypeDouble

    2. DTypeInteger

    3. DTypeBoolean

    4. DTypeString

    5. DTypeArray



  2. Constant values

    1. Numerical values - e.g. 2.5, 0.09, 3.14

    2. String values - e.g. "apple", "this is not a function".

    3. Boolean values - i.e. True and False.


  3. Cell References - e.g. B2, B2:D4

  4. Precedence - i.e. every operation and function has defined precedence and it is flexible to change.

  5. Parentheses - i.e. ( and ), with nesting

  6. Operations

    1. Unary Operations - e.g. + (identity), - (negation). Only prefix operations, as of now.

    2. Binary Operations - e.g. + (addition), - (subtraction), * (multiplication), / (division), ^ (exponentiation),
      % (modulo), < (less than), > (greater than)



  7. Named (Strongly Typed) Functions

    1. Nullary Functions - e.g. e(), pi()

    2. Unary Functions - e.g. sqrt(x), abs(x)

    3. Binary Functions - e.g. pow(x, y), gcd(x, y), lcm(x, y), min(x, y), max(x, y), ifeq(x, y)



🔍 Complex Features


Table Editor was created with flexibility in mind, with minimalistic (but clean!) UI to guide the user through.

Even though it is a small project, there are some cool features, such as:

  • New operations - Table Editor provides you with tokenizer & parser that are not restricted to the aforementioned operations. It is easy to add new operations (both unary and binary), and define their functionality within just a few lines of code.

  • New (strongly typed) functions - Functions are also very simple to add - interface created lets you create functions with any number of arguments, accepting anything as their arguments and having as complex functionality as you wish.

  • Scalability - Table Editor provides scalable code that can generalize onto various datatypes within the table. Functions provided are oriented towards Double data type (i.e. custom-defined DTypeDouble), however one can add various functions and even extend singular function to be capable of accepting different kinds of operators and return different types.

  • Event handlers - One-click row and column selection can be scaled into something greater.

💡 Examples

Expression
Evaluation
Comment

=sqrt(abs(-16))
4
Function nesting is possible.

=pow(max(1++1, ---1000), 3)
8
Same unary / binary operations can be concatenated.

=pow(min(B1^2, abs(-1000)), 3.0)
64.0
For cell value B1 = 4. Casting from DTypeInteger to DTypeDouble is implemented.

=5 + e() - pi()^2
-2.1513225726303133
Nullary functions can used for constants, and are treated as numerical values

=ifeq(pow(5, 2), 25)
True
pow(5, 2) returns 25, which is the same as 25.

=ifeq(2 < 10, 1.0)
False
2 < 10 evaluates to True, which can't be compared with DTypeDouble(1.0).

=("abc" < "dddd") + 10
11
("abc" < "dddd") evaluates to True, which can be added to the DTypeInteger(10) to get 11!

=ifeq("w" * 3 + "123", "www123") * 5
5
String concatenation and repetition of N times is supported, too!


=ifeq("w" * 3 + "123", "www123") * 5
=ifeq("www" + "123", "www123") * 5
=ifeq("www123", "www123") * 5
=True * 5
=5


=sum([1, 2, 3, 4])
10
Functions with variable length of arguments are supported!

=average(A1:B2)
2.5

For table:



A
B


1
1
2


2
3
4


A1:B2 returns a DTypeArray([[1, 2], [3, 4]]), which is then evaluated to get the result DTypeDouble(2.5)

🔥 Latest Modifications


Table Editor now supports DTypeArray parsing and, therefore, functions whose arguments are of variable length.

Table Editor now supports Cell Range References!

Table Editor now supports DTypeArray - used for manipulation of DType data stored within a multi-dimensional array.

Table Editor is now fully typed! Functions accept typed parameters, and don't do conversions (as they did in the past).

Tests have been added for operations (type-wise combinations), functions, and general expressions! Make sure to check them out:
./gradlew test

Table Editor now supports DTypeString - used for manipulation of String literals!

Table Editor now supports DTypeBoolean - used for manipulation of Boolean values (True / False)!