Skip to content

Commit

Permalink
feat: EDA on pipeline Tables (#834)
Browse files Browse the repository at this point in the history
### Summary of Changes

- MVP of EDA analysis through the VS Code extension
- Working
    - Table viewing of pipeline extracted data
    - Column reodering
    - Column resizing
    - Window resizing with table adapting
    - Selecting Columns
    - Selecting Rows
    - Column header context menu to select, and unselect columns
    - Sidebar content: Table name and Row count
    - Sidebar resizing and table realigning
    - Profiling drop down with just sample text
    - Id/Row number column
    - Displaying of large data through dynamically loaded rows
    - Loading indications and proper presentation as a window of VS Code
- Multiple exploration windows at same time and reordering them in
vscode
- returning to a running exploration if selecting same placeholder again

### To start

1. Have a pipeline with an imported table, like having this stub in
directory:
```
package a

class Table {
    @impure(
        [
            ImpurityReason.Other
        ]
    )
    static fun from_csv_file(name: String) -> table: Table
}

@impure(
    [
        ImpurityReason.Other
    ]
)
@PythonCall("from safeds.data.tabular.containers import Table")
fun __import_Table()
```

and then this pipeline, while having the relevant CSVs stored in proper
locations (can get from Kaggle, change paths accordingly):
```
package a

pipeline mainpipeline {
    __import_Table();
    val i = 0;
    val i2 = i + i + 3;
    val i3 = "abc";
    val i4 = true;
    val i5 = -1.2491891891;
    val Titanic23 = Table.from_csv_file("/home/jonas/titanic.csv"); // pfad
    val Cerea25l = Table.from_csv_file("/home/jonas/cereal.csv"); // pfad
    val Netflix23 = Table.from_csv_file("/home/jonas/netflix_titles.csv"); // pfad
    val Tweets123 = Table.from_csv_file("/home/jonas/tweets.csv"); // pfad
}
```
2. Right click on table variable and select "Explore Table"
3. If the selected placeholder was valid the table will show in a new
window after loading

Other way:
- Press "ctrl + shift + p" (for vscode commands) and start the EDA
command, the one from right click that works if your cursor is in right
position is "EDA: Explore Table"

---------

Co-authored-by: WinPlay02 <winplay02_gh@woberlaender.de>
Co-authored-by: Lars Reimann <mail@larsreimann.com>
Co-authored-by: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com>
  • Loading branch information
4 people authored Feb 13, 2024
1 parent 7ee4eb8 commit f42c9aa
Show file tree
Hide file tree
Showing 45 changed files with 7,727 additions and 3,635 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
**/node_modules/

# Compilation/build outputs
**/coverage/
**/dist/
**/lib/

# Configuration
/vitest.config.ts
/packages/safe-ds-eda/svelte.config.js
/packages/safe-ds-eda/vite.config.ts
/packages/safe-ds-eda/types/*.d.ts
17 changes: 10 additions & 7 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ module.exports = {
tsconfigRootDir: __dirname,
project: 'tsconfig.eslint.json',
},
settings: {
jest: {
version: 28,
},
},
extends: '@lars-reimann',

extends: '@lars-reimann/svelte',
rules: {
'import/extensions': 'off',
'import/no-extraneous-dependencies': 'off',
'vitest/prefer-lowercase-title': 'off',
'svelte/valid-compile': 'off',
},
overrides: [
{
Expand All @@ -22,5 +18,12 @@ module.exports = {
'no-console': 'off',
},
},
{
files: ['*.svelte'],
rules: {
// Leads to false positives when running ESLint in CI with the MegaLinter
'import/no-unresolved': 'off',
},
},
],
};
2 changes: 2 additions & 0 deletions .github/linters/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"extends": "stylelint-config-standard",
"rules": {
"custom-property-pattern": null,
"no-descending-specificity": null,
"selector-class-pattern": null
}
}
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
- name: Compile TypeScript
run: npm run build

- name: Check Svelte components
run: npm run check -w @safe-ds/eda

- name: Test with Vitest
run: npm run test-with-coverage

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
- name: Compile TypeScript
run: npm run build

- name: Check Svelte components
run: npm run check -w @safe-ds/eda

- name: Test with Vitest
run: npm run test-with-coverage

Expand Down
8 changes: 6 additions & 2 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ JSON_PRETTIER_FILE_EXTENSIONS:
- .scss
- .htm
- .html
# - .md
- .svelte

TSX_ESLINT_FILE_EXTENSIONS:
- .tsx
- .svelte

# Commands
PRE_COMMANDS:
- command: npm i @lars-reimann/eslint-config @lars-reimann/prettier-config
- command: npm i @lars-reimann/eslint-config-svelte eslint-plugin-vitest @lars-reimann/prettier-config-svelte
Loading

0 comments on commit f42c9aa

Please sign in to comment.