Skip to content

Feature: Add TSV support for easier Excel copy-paste#90

Open
colinbendell wants to merge 1 commit intonowthis:mainfrom
colinbendell:feature_add_tsv_flow
Open

Feature: Add TSV support for easier Excel copy-paste#90
colinbendell wants to merge 1 commit intonowthis:mainfrom
colinbendell:feature_add_tsv_flow

Conversation

@colinbendell
Copy link
Copy Markdown

It's really janky to build a Sankey from Excel or Google Sheets. Ideally, we could copy-paste from three columns that have the source, target and amount columns.

This PR adds support for tab separated definitions allowing for:

Wages \t 1500 \t Budget
Other \t 250 \t Budget

It also supports order confusion in the garget and amount columns:

Wages \t Budget  \t 1500
Other \t Budget \t 250

Additionally, it is much more lenient with the amount allowing for formatted values in a copy-paste to be gracefully handled:

  • Wages [$1,500] Budget
  • Wages [1 500,00 €] Budget

In an attempt to make the minimal amount of changes without wholesale refactoring, I've added tests and necessary shims for tests of the regex.

Summary of changes in the PR:

  • support for TSV node definitions
  • target-name and amount column confusion (swap detection)
  • graceful amount detection, removing formatting
  • tests for node definition regex's

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant