Code Monkey home page Code Monkey logo

Comments (7)

adb-luna avatar adb-luna commented on June 10, 2024 1

Thanks @brunchboy! You are correct that defining the column labels with more entries solves the problem. Thank you for looking into this, and I offer my condolences for the loss of your parents.

For anyone needing details, this is working:

(def column-labels (str/split "31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0" #","))
(def boxes-per-row 32)
(draw-column-headers )

from bytefield-svg.

brunchboy avatar brunchboy commented on June 10, 2024

Can you please supply a stack trace that gives more details about where the problem is happening? I may be able to help, but you might need to write your own entire set of functions to extend it in this direction as well.

from bytefield-svg.

adb-luna avatar adb-luna commented on June 10, 2024

Thanks for the help @brunchboy. Here is the stack trace.

/home/account/node_modules/bytefield-svg/lib.js:369
var sj=function sj(a,b,c,d){var f=pj(c),k=a.A-1>>>b&31;5===b?f.l[k]=d:(c=c.l[k],null!=c?(b-=5,a=sj.s?sj.s(a,b,c,d):sj.call(null,a,b,c,d)):a=rj(null,b-5,d),f.l[k]=a);return f};function tj(a,b){throw Error(["No item ",p.La(a)," in vector of length ",p.La(b)].join(""));}function uj(a,b){if(b>=qj(a))return a.fb;var c=a.root;for(a=a.shift;;)if(0<a){var d=a-5;c=c.l[b>>>a&31];a=d}else return c.l}function vj(a,b){return 0<=b&&b<a.A?uj(a,b):tj(b,a.A)}
                                                                                                                                                                                                ^

Error: No item 16 in vector of length 16
    at tj (/home/account/node_modules/bytefield-svg/lib.js:369:199)
    at vj (/home/account/node_modules/bytefield-svg/lib.js:369:437)
    at K.g.$ (/home/account/node_modules/bytefield-svg/lib.js:375:282)
    at Function.C.Na (/home/account/node_modules/bytefield-svg/lib.js:109:158)
    at /home/account/node_modules/bytefield-svg/lib.js:1814:170
    at /home/account/node_modules/bytefield-svg/lib.js:1814:182
    at /home/account/node_modules/bytefield-svg/lib.js:1814:206
    at kh (/home/account/node_modules/bytefield-svg/lib.js:196:54)
    at jh.g.U (/home/account/node_modules/bytefield-svg/lib.js:198:376)
    at B (/home/account/node_modules/bytefield-svg/lib.js:87:84)

from bytefield-svg.

brunchboy avatar brunchboy commented on June 10, 2024

Hmm, I need a Clojure stacktrace, not a Javascript stack trace, I am a Clojure developer. I can’t make sense of that, I’m afraid. I don’t see how to relate it back to my source code. If you can figure out the root cause here I’d appreciate very much hearing it.

from bytefield-svg.

brunchboy avatar brunchboy commented on June 10, 2024

(From that I can’t even see the function that is throwing the exception, which is step 1 in figuring out what is causing it.)

If I find myself with a bunch of time to spare, I may try to re-learn how this project builds and whether there is a way to run it that is less heavily compiled, to get better debugging. But I am preparing for a memorial service for both my parents, who passed away rather abruptly recently, and am also busy with my main open source projects, so I can’t predict when I would be able to do that. In the mean time, you might want to try adding some debugging code of your own and see if you can pin this down.

from bytefield-svg.

brunchboy avatar brunchboy commented on June 10, 2024

OK, I am getting somewhere. If you run it from the command-line in the top of the project source, like so:

npx bytefield-svg <test.edn >test.svg

Then you get stack traces from the Clojure source, not the minified Javascript build, which tell you far more useful information. I have been able to reproduce the problem, so I will be able to poke at it a bit as I find time.

from bytefield-svg.

brunchboy avatar brunchboy commented on June 10, 2024

Ah ha! Your problem is happening here:

And that is because it is trying to ask for the seventeenth column label, and there are only sixteen of them defined as I ship it. You are going to need to decide what you want as column labels for all of your columns, and set those up, before you try to draw your boxes. You can do this by defing a new value in the predefined value column-labels, or calling draw-column-headers yourself with your own vector of labels before you draw the boxes.

from bytefield-svg.

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.