Giter Site home page Giter Site logo

Comments (4)

srinisubramanian avatar srinisubramanian commented on May 20, 2024

My Bad: This is NOT an issue with recogito-js.

What I realized is that due to the DOM modification and restoration, the text coordinates have changed (addition of spaces and new line characters). Unfortunately I do not have control over this. Is it possible to determine annotations without using
the TextPositionSelector with offset/length?

from recogito-js.

rsimon avatar rsimon commented on May 20, 2024

Hi @srinisubramanian,

hm, yes. Dynamic changes to the DOM is something that RecogitoJS may not be very good at. Do you mean the same text might differ on re-render? I don't think there's a way to handle this. At least RecogitoJS will always base the selection on the text offset.

Perhaps there's a way to keep the situation more stable between re-renders by using pre-formatted text? (Either by packing it into a <pre> tag, or by applying a white-space: pre; style. In this case, trying the two different mode settings that RecogitoJS provides might help:

https://github.com/recogito/recogito-js/wiki/API-Reference#initializing-recogitojs

from recogito-js.

srinisubramanian avatar srinisubramanian commented on May 20, 2024

Hi @rsimon will try the pre mode and let you know

from recogito-js.

srinisubramanian avatar srinisubramanian commented on May 20, 2024

pre is not an option as formatting is messed up.

Will have to try a different solution so the text does not change.

from recogito-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.