Comments (7)
Good question! Currently, there is no recommended way to visualize changes. However, it should not be difficult to make your own method of doing this, and if you make an open-source library for this, I would love to feature it on the Microdiff README. Also, #17 should help once it is merged.
from microdiff.
I like the library. But is there a recommended way to visualize the output? I'm looking for something that looks like jest-diff output or "github PR changes", e.g just for the terminal?
Hello, would you like to visualize the output like this one?
(Green - was created, Red - was deleted, Yellow - was changed)
from microdiff.
Hello, would you like to visualize the output like this one?
Yes, exactly.
Like github visualizes differences. Or Jest.
from microdiff.
Hello, would you like to visualize the output like this one?
Yes, exactly.
Like github visualizes differences. Or Jest.
Okay, I asked because GitHub cannot show that something has been changed. It shows that the content of the line was deleted and then added, but the microdiff has a CHANGE type. So it will be okay to have a third format for changed values?
from microdiff.
Aha, then I misunderstood.
No, I don't see the need for CHANGE type, but instead I expect to see "what exactly" is changed in that line. E.g if a string is changed, it would show in red the removed characters and in green the added characters.
from microdiff.
So, consider these objects like old and new
const oldObject = {
a: 'value',
b: 'old value'
};
const newObject = {
b: 'another value',
c: 'new value'
};
Would you like to get output like this?
from microdiff.
Closing this because a solution to this should be developed separately.
from microdiff.
Related Issues (20)
- Recreation from diff HOT 8
- Does not handle object changes within array HOT 2
- How about having index path for array be a number instead of a string? HOT 2
- Is it possible to see the old value? HOT 2
- Consider supporting JSONPatch HOT 10
- Possible optimization: hashing HOT 2
- UMD bundle HOT 2
- support for NaN values HOT 1
- Ineficient change detection HOT 1
- Community Exchange Introduction/Tracking HOT 6
- Add templates for issues HOT 2
- Update README.md HOT 2
- Add Code of Conduct HOT 2
- get array removals as "DELETE" HOT 7
- ➕ Feature - Export DIFFERENCE Type so it can be imported in Ts projects HOT 2
- Inconsistent diff Behavior for Object-derived Type Changes HOT 2
- Loops / infinite recursion HOT 9
- Cannot use 'in' operator to search for ... in null HOT 4
- Circular references HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microdiff.