These are chat archives for FreeCodeCamp/HelpJavaScript

7th
Nov 2018
Jason Luboff
@JLuboff
Nov 07 2018 00:04
Gah...what a stupid fucking feature this is
@bradtaniguchi You ever get that? Some stupid ass feature the client wants?
Brad
@bradtaniguchi
Nov 07 2018 00:06
Yup, all dah time
Jason Luboff
@JLuboff
Nov 07 2018 00:07
I'm implementing something that is basically counter intutive to the workflow
Brad
@bradtaniguchi
Nov 07 2018 00:11
Yup, seen projects filled with those
Jason Luboff
@JLuboff
Nov 07 2018 00:13
Makes me sad...but.. at the same time... its ensuring I'm employed and getting paid..so...
Brad
@bradtaniguchi
Nov 07 2018 00:14
Yea, as long as they are willing to pay (we've had clients that try to get as much requirements for the least amount of $, huge PITA)
Jason Luboff
@JLuboff
Nov 07 2018 00:16
Everything I'll create will be in house (unless for some reason something else comes up where we start selling what I made but I really don't see that happening)
Hmmm...think I just realized my other project would be good for Electron...
Brad
@bradtaniguchi
Nov 07 2018 00:29
I always wanted todo an electron app, endedup up doing an nw.js app. I heard Angular has some good integrations with electron. I think it's part of the "write once deploy mutliple" setup, where you create an Angular app that is generated into a PWA, Electron app, and chrome app. Hehe :D
Jason Luboff
@JLuboff
Nov 07 2018 00:30
Psh...I aint touching Angular
But... the project will only allow certain users, and should essentially "not exist" for any one else..so originally my thought was just create a shortcut on the users desktop for it... but Electron app would be a lot better, than no one who isn't authorized would even be able to navigate to it
Brad
@bradtaniguchi
Nov 07 2018 00:31
Navigate to the app on their desktop?
Jason Luboff
@JLuboff
Nov 07 2018 00:32
I guess browse to it. It needs to be hidden (I'll implement authorization but non-users should not know it exists)
So as a web app, I would have placed a shortcut to the sites landing page on only the authorized users computer.
But theoritically, another user (who is not authorized) could potentially find it (it would be difficult as I won't have it running on port 80 and probably be the server name)
Brad
@bradtaniguchi
Nov 07 2018 00:34
Sounds like the amount of work to "show" the app is the same then, either the entire electron app, vs a web-link. Everything else sounds like it could be the same tho
Jason Luboff
@JLuboff
Nov 07 2018 00:34
Ya... but I like the idea of an Electron app lol
Brad
@bradtaniguchi
Nov 07 2018 00:35
Haha me too, what about a PWA, the best of both worlds :P
Jason Luboff
@JLuboff
Nov 07 2018 00:36
PWA === Progressive Web App?
Brad
@bradtaniguchi
Nov 07 2018 00:37
Yes
Jason Luboff
@JLuboff
Nov 07 2018 00:37
Is that Chrome specific?
Brad
@bradtaniguchi
Nov 07 2018 00:38
Nope, PWA is supported by all modern browsers
I think windows 10 just added more PWA features recently, forgot what it means tho
Jason Luboff
@JLuboff
Nov 07 2018 00:41
Ah
Pagnito
@Pagnito
Nov 07 2018 03:56
anyone ever use gifshot?
Pagnito
@Pagnito
Nov 07 2018 04:29
how do i convert an image to this type of string?
����JFIF��C↵ ↵ ↵

  ��C  

��M�"�� ��F!1AQ"aq2���B�#R���3��br$C4�&S�5D�������7!1AQa"2q����#��3��$B�Rbr�� ?��� :H��A�gӕ
���t���U��d�&�=2↵[ NѤԔd}���-���֎ܰ��i�:)W��7�� B@��ķ��SE���-W[0�)O.�̹�mC֘�x#I�A�ҩ��$F��H�d�DoP�SC����XpB�@܎��2&�+�'��O�̻���?js���U-� �|2�������ʅ��@�A�t4moGe�oCF�HD�J4c��Rg�֠+5�K� ��5#GI!�)q?�V����,'ҕy]D"�A���B )��-��2����m4á��h���Ȕi+�+;5�]↵����J��� }G9֢�¬�pn��֠��\�6�9���D2޻u#��� �M��S�&��}h. �vү�0����4�f(�> ��GR�]Ea�L�l�.X↵D���b�h$�ˮ� x/#D2���X�-�V���z�0@.��9�>��<a�� C[ɛN_�Ӥ�w�x�:�j�xeG�c������T���ۄ�\�Xޡm�xk` �f~��*�Þ`̩Tc�@Qo���'�j�c���Ը���–�Y�H�F�")�h��;D��b�u�3�-�]OڀK�����eA���,�����%����j���92����R���^�MF����M�P7�M:⩽g1�QB�DS�۱o8��<��.԰����)锍���/�n3�� @�d��]q溇0Ӯ�塧��8{(� ��֐�ٸ�'%� gqҀ�kvٖd$�$�iV���mTh��I��*v"�~P�Y�T�4$��B�q7@ � �7(P>�W��.�����h/�ն�d�����Ъ1spI w��}A��U�xj�4�N�AL� m!�%Ȁ7�a�ηI1ȝ��Me��� a�iL?�S\َ���W-�u�$������հ�If���#ڬ_B,LJ���l=>��8�r�&M�O捨Q*%RJ,*�����S��ʾf3�� ���v��`��O�X�X8��x�1�:P��@�J&w�P����0 .Q���F�Į�V��Qo)�g���#����d�d�c} OΕo��i\�ڨ�(�b-�u�F�gӥ,�6KYGU��&��4e$�#i���O�� zQ�� H̋�$��\ �|��w+Ib(PXE����ǹ�g�z���go+�]9Q�-+n���:��3�]r������X����P��X@?�f��!��,X���Ҋͼ�v3 �]�԰[����q��B(�n�*Y$�5��z�V� ���#�z�))z�+��"�KeD�BO�S'��!����kn�u�۴.=�:.�ONSEm�̤MEA�h+[�]yU�&Ү �l�Ș���i��q�:��M���t� s�6@��8� u4��4�r-�L�̻��VQ.�,��N����n�cUH���Hb 6�ʱ:A��9G�F�s�}*&T��Sr�|"Cr�*.����T��@,2��s�[�3�&Th:����:�6EW �C��@ �Li'^tAe�A��4K�����;������."N_�#O�^a�B���@X��M�*�Za��SB��V�h��(��E�↵A���{l��'��]$@�Xjĉ��R ���K�?�u��X�L}V1�N�������i�r�A�� � �Dj*q(^�<M�V*�d�0Ӥt����[f���u���g��E%-�(u�c �:�u�G:7��.�nw��$B�[�\���&��@Q�:u�w�I���Z���J���PT$����.�փ1[6��I ��W-؅\��'~t?��[0��O}�ݸm^,d�↵�LZ J�� �/���HkjZI>f�=i��{wF�H��NRӀ�$�_�-�-���\Ăz�g�� fi$��}�.Y��.LS�WA6�ı���R��� ������X�3+��������ژ���~������f!�|���LK�|3��?)�Y����"��↵0��t��jىM���H�<6m3�юï֡_ ^2��N�+p;�0�9O�@U� [v��W���7A��shLH�f~��2^f�Т4h:�Z_p�_ X:�M@b�[O�&�3���R�e���������{��m+�+�_C�(���ʍg(���H����p9��v ��n@nC�9��]�9� [H�d[�Bk�Bzk�@V[QqQ�dT�B�v9�� F���b� ��@$ �AJ�o�@$i(6j��|�b��·'�u� F���DS�hq��}u��caK�-�\s��j�]�lE�T��&9 �>�]l���c��$��jK��h`Ir�K���p�\����@�����mʉԳo>��ſ<�����^��t�*��Ή���II��h↵-������M�Vm�↵�0?T�^�h�Rm�Ք���)J�����O1ʅ�CvL�UY���5���(ÒzU� ���-O���]$�R F��@��J!#�(�������k��#�c��.!\��9A^��+Ų7|�O,�J � Y(`@�mT�Y)te����z�.[8�3Y-������۹�5�X s;MT�k#ٷ& $�6'Y��/$ᭃ9��:�v- *KL�1�T��[`°�z� ��"�����v����Z�}_DU�X�dG��S�$X���2���k��J��O���}���(۷�r�`B�Ȟ~�S�:�����e���a���ҳ�(m1XR��J���+��t�?M�n!��f���߇����V�N�u�y��P��N�G�u�T!M��xp���ֲ�u����JʥɼW���Sr�'qʅ7�B��zp�:D�"�2"�hA44�hu�IҖ��DhH�i��A�9� ��GJb!˗� D� �d��:u�F�4�����є�ecj5\����� 4)Ѳ����1 ��kY�D�9ޚ�'H���!e�L�(@ �;�� r4.�݈t�b�: ����$P���g}��2*���N���k�����T�<�����nbE@Wt↵��H.�A����-�,i�L$���@t�� �r�mI��r�B��I�B�O#Sn�����:�-)]vP��X�K�↵d�L��1:Ee�9CgQެ g*����6����?zd�[6�u��EK�Xѯ��Oe��3 @��`P�o�в�=*��b���6��е��2%`�M6�[�H�R8��p�ms����>+�U��j6��E�̥N��e=H�<��� {�?�q-�\vWQ��W:�CEs��ͤ��y�G�Q6�� ��|���R��i�F���ώ���It�`1�֨*���NR��zV&Z&`@?:0���0&|��}��Ņ�.��\��*$&v�l�~�aa��V� 9&)c��(؏ڀ���c˗,�↵�J(�z�r$��BH�t����Z�V � *�:΂���>a�V�N�� ws�0,���t�T��j̓ �s�x�o�Q hǐ��1vG��Hc��P�^�o��d��h�'5�u;(-�}(ЕEב&7�We+��3}'Z�mX{�RSВt��U� NAs�h����u�g�XiQ� ��v`�ܒsJ�u���<� �?S�B�\AbteV �b�6W�� O��@�8��S�,��↵W�r�\��\2"7ڳ�p�Nஜ�S2 v·*4 <��.y�e �i��lJ�a��ȅDs��4��Q���u����t�_�$�f^�h>��W��2����|��m�tf3�R��j%�62G&^CV�|�IvM ��Mi�6[GR3ޝ΅"��/ªa�Nu^�͆ �;���6��hN����1��Q������q��r��Z��p �H �|]h�����↵1�e�&���b��� d�ہ�/��@-�G%��eoo���7�2SO{nmL�ĂO��J
Dovydas Stirpeika
@Giveback007
Nov 07 2018 05:52
@Pagnito whats the file extension?
``
{ test: /\.(jpg|png|woff|woff2|eot|ttf|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, use: [{ loader: "file-loader", options: { name: "assets/[name].[ext]", } }] }
Pagnito
@Pagnito
Nov 07 2018 05:52
it has diffierent ones, but i figured out that the library im using that takes this format, takes base64
well i mean i read it in their docs lol
Dovydas Stirpeika
@Giveback007
Nov 07 2018 05:53
if you add file loaded it might fix the problem
Pagnito
@Pagnito
Nov 07 2018 05:53
so im guessing this is base64
Pagnito
@Pagnito
Nov 07 2018 06:06
YES!!!!!
fckyes!!
omg thank fck god
i finished the main part of the function of my current project and can focus on the lil things tomorrow
feel like my soul just took a big dump
Jason Luboff
@JLuboff
Nov 07 2018 16:14
Morning :wave:
Tom
@moT01
Nov 07 2018 16:16
hello
Christopher McCormack
@cmccormack
Nov 07 2018 16:22
morning
Nate Mallison
@NJM8
Nov 07 2018 16:26
Have you guys used charts js a bunch?
I'm finding the documentation really annoying
Christopher McCormack
@cmccormack
Nov 07 2018 16:27
not a bunch
just a little with React
Nate Mallison
@NJM8
Nov 07 2018 16:32
did you get the tooltips to work? they are killing me slowly
Christopher McCormack
@cmccormack
Nov 07 2018 16:32
yeah but I didn't put much effort into it
Nate Mallison
@NJM8
Nov 07 2018 16:33
What really drives me up the wall is they have tons of examples with NO CODE
maybe @JLuboff he used it for his stock app
Nate Mallison
@NJM8
Nov 07 2018 16:34
I used it for my voting app too but I think the chart I am using now doesn't use tooltips by default. I can get them working just only all the time
so anytime you are hovering over the chart it shows the tooltip for the nearest point, annoying
Christopher McCormack
@cmccormack
Nov 07 2018 16:39
hmm can you pass a callback to control when it's displayed?
Jason Luboff
@JLuboff
Nov 07 2018 16:41
Hey sorry...was talking business with a coworker.. what up guys
Nate Mallison
@NJM8
Nov 07 2018 16:42
I copy and pasted this tooltip code and it doesn't work at all
Christopher McCormack
@cmccormack
Nov 07 2018 16:45
@NJM8 in the codepen it works, are you saying it doesn't work locally?
They're using 2.2.1 if that makes a difference
Jason Luboff
@JLuboff
Nov 07 2018 16:47
$11 for vanilla? What the shit
Christopher McCormack
@cmccormack
Nov 07 2018 16:49
interesting so the label data comes from the chart, not something you pass to it, the x and y values for each item
{
  "xLabel": "Vanilla",
  "yLabel": 11,
  "index": 0,
  "datasetIndex": 0
}
Jason Luboff
@JLuboff
Nov 07 2018 16:54
Whats everyone working on today?
Christopher McCormack
@cmccormack
Nov 07 2018 16:55
work work
Jason Luboff
@JLuboff
Nov 07 2018 16:55
Fun fun
Christopher McCormack
@cmccormack
Nov 07 2018 16:55
no
you?
Jason Luboff
@JLuboff
Nov 07 2018 16:56
work work
:)
Nate Mallison
@NJM8
Nov 07 2018 16:56
Ah I see my problem.
Jason Luboff
@JLuboff
Nov 07 2018 16:56
Working on feature updates for MOC program. Probably work on my newer project a bit later. Need to do some database testing on a specific app
And....technically I guess I have a computer to build up...but..meh
Nate Mallison
@NJM8
Nov 07 2018 16:57
I want the nearest intersect behavior but I am using the chart to great a gantt chart and the bars are actually the border not the point, so it isn't recognizing the hover
Christopher McCormack
@cmccormack
Nov 07 2018 16:59
yes yes
Jason Luboff
@JLuboff
Nov 07 2018 17:02
yes yes
Tom
@moT01
Nov 07 2018 17:04
@NJM8 got it figured out? I've used it a few times
Nate Mallison
@NJM8
Nov 07 2018 17:08
I think I'm just going to have to settle for the tooltip all the time. Now I just need to customize what it shows
Jason Luboff
@JLuboff
Nov 07 2018 18:01
@alpox My man
alpox
@alpox
Nov 07 2018 18:01
@NJM8 They used an old version of chart.js in that codepen. I updated it here and added the intersect behavior you said. Not sure exactly what you want though :D
@JLuboff Hio
Jason Luboff
@JLuboff
Nov 07 2018 18:02
Whats up?
alpox
@alpox
Nov 07 2018 18:03
Ah work as usual. Many animations and diagrams...
Jason Luboff
@JLuboff
Nov 07 2018 18:03
Fun.. haha
alpox
@alpox
Nov 07 2018 18:04
Yea it kinda is :D
I get to know D3 real good
Jason Luboff
@JLuboff
Nov 07 2018 18:04
Well there you go
Christopher McCormack
@cmccormack
Nov 07 2018 18:04
Good now I know who to bother when I have a D3 question :)
alpox
@alpox
Nov 07 2018 18:05
@cmccormack Eh yea just ask along :D
Jason Luboff
@JLuboff
Nov 07 2018 18:05
@alpox is the all knowing
Christopher McCormack
@cmccormack
Nov 07 2018 18:06
@alpox plz go animate all my d3 projects thanks
alpox
@alpox
Nov 07 2018 18:06
@JLuboff That'd be cool if I was :D
@cmccormack Thats no question :P
Christopher McCormack
@cmccormack
Nov 07 2018 18:07
@alpox plz go animate all my d3 projects thanks?
alpox
@alpox
Nov 07 2018 18:08
@cmccormack I could guide you through it :D
Christopher McCormack
@cmccormack
Nov 07 2018 18:08
see there is a question mark
:)
Nah it's OK if I decide to animate I'll just read up on it
thanks though :)
alpox
@alpox
Nov 07 2018 18:09
? thats ? a ? real ? cool ? questionmark ?
Christopher McCormack
@cmccormack
Nov 07 2018 18:09
¿¿¿¿¿
Jason Luboff
@JLuboff
Nov 07 2018 18:11
Async/await function question incoming
alpox
@alpox
Nov 07 2018 18:11
Oh oh
Jason Luboff
@JLuboff
Nov 07 2018 18:11
Is this the proper way to turn this promise function into an async/await function?
exports.hazardAndControl = () => {
  const request = new db.Request();

  return request
    .query(`SELECT hrc.HazardID, h.HazardName, hrc.ControlID, c.ControlName
              FROM dbo.HazardRefControl hrc
                INNER JOIN dbo.Hazard h
                ON hrc.HazardID = h.HazardID
                INNER JOIN dbo.Control c
                ON hrc.ControlID = c.ControlID
                ORDER BY HazardName, ControlName`)
    .catch((err) => {
      const errorMsg = `(read)hazardAndControl Error: ${err}`
      return Promise.reject(errorMsg);
    })
    .then(result => result.recordsets[0])
}

exports.hazardAndControl = async () => {
  try {
    const request = await db.Request();

    return await request
    .query(`SELECT hrc.HazardID, h.HazardName, hrc.ControlID, c.ControlName
              FROM dbo.HazardRefControl hrc
                INNER JOIN dbo.Hazard h
                ON hrc.HazardID = h.HazardID
                INNER JOIN dbo.Control c
                ON hrc.ControlID = c.ControlID
                ORDER BY HazardName, ControlName`)
  } catch (err) {
    const errorMsg = `(read)hazardAndControl Error: ${err}`
    return errorMsg;
  }
}
I haven't tested it...but..have a feeling I might have the return wrong..
Christopher McCormack
@cmccormack
Nov 07 2018 18:12
in the try?
alpox
@alpox
Nov 07 2018 18:12
Hmm also, those are not equal
Christopher McCormack
@cmccormack
Nov 07 2018 18:13
you're handling the promise differently in each scenario
Jason Luboff
@JLuboff
Nov 07 2018 18:13
Ya.. I didn't think I had it right lol
alpox
@alpox
Nov 07 2018 18:13
exports.hazardAndControl = async () => {
  try {
    const request = new db.Request();

    const result = await request
    .query(`SELECT hrc.HazardID, h.HazardName, hrc.ControlID, c.ControlName
              FROM dbo.HazardRefControl hrc
                INNER JOIN dbo.Hazard h
                ON hrc.HazardID = h.HazardID
                INNER JOIN dbo.Control c
                ON hrc.ControlID = c.ControlID
                ORDER BY HazardName, ControlName`)

      return result.recordsets[0];
  } catch (err) {
    const errorMsg = `(read)hazardAndControl Error: ${err}`
    throw errorMsg;
  }
}
That is the equivalent
Jason Luboff
@JLuboff
Nov 07 2018 18:14
Ah. So I wasn't too far off. The return needs to be outside the try block though?
alpox
@alpox
Nov 07 2018 18:14
Hmm this is sitll not equivalent though
Christopher McCormack
@cmccormack
Nov 07 2018 18:15
that isn't valid
alpox
@alpox
Nov 07 2018 18:15
Ah it is
Christopher McCormack
@cmccormack
Nov 07 2018 18:15
you may not have recordsets if you hit an error
alpox
@alpox
Nov 07 2018 18:15
Yea give me a sec and I make it right
Jason Luboff
@JLuboff
Nov 07 2018 18:15
But the catch block would keep the recordset from being defined, no?
or I should say that it would return in there
meaning the recordset would never be returned
Christopher McCormack
@cmccormack
Nov 07 2018 18:16
your try return only returns a promise
alpox
@alpox
Nov 07 2018 18:16
So now - corrected
Christopher McCormack
@cmccormack
Nov 07 2018 18:16
async functions return promises
just be wary of that
Jason Luboff
@JLuboff
Nov 07 2018 18:17
Ya I know they return a promise, I'm still not 100% on how to convert from a Promise function to async function lol
alpox
@alpox
Nov 07 2018 18:17
@JLuboff In the first version I had, it could have been returned even in case of an error - which would lead to another error. I corrected it now to be equal
exports.hazardAndControl = async () => {
  try {
    const request = new db.Request();

    const result = await request
    .query(`SELECT hrc.HazardID, h.HazardName, hrc.ControlID, c.ControlName
              FROM dbo.HazardRefControl hrc
                INNER JOIN dbo.Hazard h
                ON hrc.HazardID = h.HazardID
                INNER JOIN dbo.Control c
                ON hrc.ControlID = c.ControlID
                ORDER BY HazardName, ControlName`)

      return result.recordsets[0];
  } catch (err) {
    const errorMsg = `(read)hazardAndControl Error: ${err}`
    throw errorMsg;
  }
}
Jason Luboff
@JLuboff
Nov 07 2018 18:17
Ok, so close to what I had but its required to assign the query to a variable and return that
alpox
@alpox
Nov 07 2018 18:17
To keep track :D
Christopher McCormack
@cmccormack
Nov 07 2018 18:17
just consider async functions conveniences but they still have most of the problems of promises
Jason Luboff
@JLuboff
Nov 07 2018 18:18
Also... throw will bubble up or no?
Christopher McCormack
@cmccormack
Nov 07 2018 18:18
yes I believe if you have a .catch on the return you can handle it
Jason Luboff
@JLuboff
Nov 07 2018 18:18
@cmccormack promises are assholes...but... I still like them... lol
alpox
@alpox
Nov 07 2018 18:18
@JLuboff throw in an async function is equivalent to return Promise.reject(..)
Jason Luboff
@JLuboff
Nov 07 2018 18:19
:thumbsup: so it'll bubble up to my calling function and will be caught in its catch block
Christopher McCormack
@cmccormack
Nov 07 2018 18:19
maybe
alpox
@alpox
Nov 07 2018 18:19
Yep
It will
No maybe
Christopher McCormack
@cmccormack
Nov 07 2018 18:19
I get confused by the nesting of errors thrown haha
Jason Luboff
@JLuboff
Nov 07 2018 18:20
I think as long as you return the Promise.reject (or throw in this case) it'll bubble up to the outermost catch block?
Christopher McCormack
@cmccormack
Nov 07 2018 18:21
I don't usually do anything with the return value of my async functions, I only make them to handle all the logic internally and then be done
except maybe a fetch helper or something
@JLuboff yeah
make a quick codepen and test :)
Jason Luboff
@JLuboff
Nov 07 2018 18:22
Query wont work...which means it would be caught... hmmm lol
alpox
@alpox
Nov 07 2018 18:23
@JLuboff It bubbles to the next outer catch block. No bubbling else
Jason Luboff
@JLuboff
Nov 07 2018 18:25
@alpox Which if that has a catch block and was called from another function, etc, it would keep bubbling up, no?
alpox
@alpox
Nov 07 2018 18:25
@JLuboff I cannot follow much :D bubbling where to?
Jason Luboff
@JLuboff
Nov 07 2018 18:26
Lets say we have 3 functions. Each has a try/catch. The inner most function throws an error. Does it bubble up only to the middle function, or to the outer most function?
alpox
@alpox
Nov 07 2018 18:28
If each has a try/catch and the innermost throws an error (Which does not get captured by its own catch), it only ends up in the middle function as long as the throwing function was called from the try block of the middle function
Ofc. unless the catch block in the middle function rethrows in which case it reaches the outermost function
Rethrowing is basically what you did in your code up there
Jason Luboff
@JLuboff
Nov 07 2018 18:30
AH. Yes, thats what I was getting at
If you have return Promise.reject... or throw in the middle function, it'll continue to the outer most function
alpox
@alpox
Nov 07 2018 18:30
Yes
It goes one more level up then
Nate Mallison
@NJM8
Nov 07 2018 18:31
@alpox You know why this isn't working?
            callbacks: {
              label: function(tooltipItem, data) {
                return data.datasets[tooltipItem.datasetIndex].label;
              }
            }
alpox
@alpox
Nov 07 2018 18:31
With a different error or the same depending on what you throw there @JLuboff
Nate Mallison
@NJM8
Nov 07 2018 18:31
I just want to replace the label for the tooltip to only show the label form the dataset
Jason Luboff
@JLuboff
Nov 07 2018 18:31
@alpox :thumbsup: Ya, so my thinking was correct I think I just wasn't explaining it very clear
alpox
@alpox
Nov 07 2018 18:32
@NJM8 Hmm looks like working in the example codepen
Nate Mallison
@NJM8
Nov 07 2018 18:34
yeah if I log it, the label is there but not updating the tooltip
alpox
@alpox
Nov 07 2018 18:35
Hmm what do you mean? Is it not working as you want it in that pen - or only local?
Nate Mallison
@NJM8
Nov 07 2018 18:36
Local, ugh, now it is working. It's hard sometimes as the table is non-reactive so hot-reloading doesn't work all the time
Now I just need to figure out how to remove the title
alpox
@alpox
Nov 07 2018 18:36
Ah i know that problem :/ had it too sometime
I usually put the drawing into the prop update lifecycle during the development for that i get some hot reload behavior
@NJM8
callbacks: {
      title: () => {},
      label: function(tooltipItem, data) {
        console.log(data, tooltipItem)
        return data.datasets[tooltipItem.datasetIndex].label;
      }
    }
:D
Nate Mallison
@NJM8
Nov 07 2018 18:41
Thanks, just did that
Maybe you can help me figure out the hover behavior too, I want the original behavior in that codepen, but my chart is a weird bar chart where the bars are the border and it doesn't activate the tool tip on the borders
I'll recreate
alpox
@alpox
Nov 07 2018 18:42
Okay :D sounds strange
Nate Mallison
@NJM8
Nov 07 2018 18:47
it's a gantt chart,
starting point
alpox
@alpox
Nov 07 2018 18:52
@NJM8 Okay :)
That looks to me like trying to do something with a library for which it wasn't designed
Nate Mallison
@NJM8
Nov 07 2018 18:53
yup
alpox
@alpox
Nov 07 2018 18:54
Are you stuck to ChartJS for this?
Jason Luboff
@JLuboff
Nov 07 2018 18:54
oh oh oh...I bet he is going to suggest D3!
alpox
@alpox
Nov 07 2018 18:56
@JLuboff Would be surely my choice :D in D3 you're your own boss, with chart.js you try to fit something for you that doesn't fit
So when intersect is set to false you have the tooltip all the time which I don't like
But if you set to true it only shows when you hover over the left point of the bar, as the bar is actually the border and the point is just the left most point
I want what this example does here: http://www.chartjs.org/docs/latest/charts/bar.html
Problem is I believe the fill will only fill from the edge to the point, if it can fill between the starting and ending point I think it would work
Ohhhhh
You can fill to another dataset, so If I set each point as a dataset and not an XY on one with a border hack then maybe the tooltip will do what I want
alpox
@alpox
Nov 07 2018 19:01
So much hacking >.<
Nate Mallison
@NJM8
Nov 07 2018 19:02
I know.
alpox
@alpox
Nov 07 2018 19:02
I'm not sure it would do that then as it would still be dependant on the single points, the fill is only a visual help in a line chart
Nate Mallison
@NJM8
Nov 07 2018 19:02
I found a bunch of great Gantt chart libraries but none of them appear to have options to not include a date
IDK why these people don't realize gantt charts are based on time but don't have to be tied to a specific date. I want it to be like a project progress overview, hypothetical
Ahhh but I just thought of a case where I would want the dates. Shit, hahaha
alpox
@alpox
Nov 07 2018 19:05
Lol :D
I still suggest you to take a look at D3.js. You can create what you need yourself with that.
May take a bit longer initially but you get exactly what you need
I threw there a quite similar diagram, custom made in 2 hours on tuesday
Jason Luboff
@JLuboff
Nov 07 2018 19:07
Isn't the whole point of a gantt chart though to show projected completion dates for each milestone?
Nate Mallison
@NJM8
Nov 07 2018 19:08
I'm making a clinical trials management application, so when you make a trial I want to show the stages as a gantt chart, but there are no actual dates until a subject joins the trial
so In the overall view there are no dates to show
alpox
@alpox
Nov 07 2018 19:08
@JLuboff I don't know whats the consensus on that but I can see both uses. If you have an exactly planned project with set times its nice to have the overview over the next time range.
But I can also see the use that one just wants to see how long stuff takes without it being bound on specific times
Nate Mallison
@NJM8
Nov 07 2018 19:09
Just visit 1 @ day 3 +- 3 days,
visit 2 @ day 7 +- 1 day
Jason Luboff
@JLuboff
Nov 07 2018 19:09
Ah...so a generic gantt chart basically
Nate Mallison
@NJM8
Nov 07 2018 19:09
visist 3 @ day 20 +- 2 days
right
Jason Luboff
@JLuboff
Nov 07 2018 19:10
Got it
Nate Mallison
@NJM8
Nov 07 2018 19:35
And magically now it's broken. Awesome
Jason Luboff
@JLuboff
Nov 07 2018 19:43
Programming. If it aint broke, you aint doing it right
Christopher McCormack
@cmccormack
Nov 07 2018 19:44
wait that doesn't seem right... haha
Jason Luboff
@JLuboff
Nov 07 2018 19:44
:joy:
Another feature to remove from the checklist
Pagnito
@Pagnito
Nov 07 2018 20:02
hey im tryin to upload a gif in base64 thats 164 kb but im getting
PayloadTooLargeError: request entity too large
Brad
@bradtaniguchi
Nov 07 2018 20:08
@Pagnito sounds like your image is to large
Pagnito
@Pagnito
Nov 07 2018 20:09
i know but its only 164 kb
it a base64 string
Brad
@bradtaniguchi
Nov 07 2018 20:12
@Pagnito probably is to large
Pagnito
@Pagnito
Nov 07 2018 20:23
yea i guess it was, odd, when i saved it in text it was only 164kb
i put a larger upload limit on bodyparser and it worked
alpox
@alpox
Nov 07 2018 20:32
@Pagnito probably it was too large
Pagnito
@Pagnito
Nov 07 2018 20:37
yea i guess so
Jason Luboff
@JLuboff
Nov 07 2018 21:23
probably it was too large
Brad
@bradtaniguchi
Nov 07 2018 21:23
could be too big too
Jason Luboff
@JLuboff
Nov 07 2018 21:24
Maybe the size is of proportions that do not fit the requirements
Brad
@bradtaniguchi
Nov 07 2018 21:24
hmm well said
Jason Luboff
@JLuboff
Nov 07 2018 21:25
:joy:
@bradtaniguchi Yo since you're here... question about squash
How do I get it so if I give each file a different commit message to work?
Brad
@bradtaniguchi
Nov 07 2018 21:26
I'm confused, what do you mean by "give each file a different commit message"
Jason Luboff
@JLuboff
Nov 07 2018 21:27
file1 //commit message = "Changed function A"
file2 //commit message = "Modified the schema"
etc etc
So when I go to squash how can I keep or specify those commit messages?
Brad
@bradtaniguchi
Nov 07 2018 21:28
Both of those messages should appear when you do your final commit, after you run squash
Jason Luboff
@JLuboff
Nov 07 2018 21:29
Ya.. but when I push that.. it ends up having the git ID and my name and the time/date instead of just the message associated with the specific file
Brad
@bradtaniguchi
Nov 07 2018 21:30
You should be able to edit all of that any way how you see fit, since you are in VIM (or the same editor you would see if you were creating a new commit)
Jason Luboff
@JLuboff
Nov 07 2018 21:32
Ya.. I delete only the commits I don't want but.. it shows up all wierd :( oh well
Brad
@bradtaniguchi
Nov 07 2018 21:33
I usually just create a summary of all the commits, deleting what is given by default. You can un-indent all the commit messages, and remove all the title crap too
Jason Luboff
@JLuboff
Nov 07 2018 21:35
I'll play around with more over time
Brad
@bradtaniguchi
Nov 07 2018 21:35
yes
Jason Luboff
@JLuboff
Nov 07 2018 21:35
I'm the only one who ever looks at it anyhow
Brad
@bradtaniguchi
Nov 07 2018 23:47
Alright time to test the super complicated feature I have little faith will work D:
ffffff
well it's half working