« first day (3493 days earlier)      last day (1680 days later) » 

00:26
hello everyone! I am currently using this sunburst chart, plotly.com/javascript/sunburst-charts, but for some reason, client wanted an image alongside the hover label. I'm willing to change to a different library if it is possible. Is it possible?
 
3 hours later…
03:54
Tagged templates are a very cool feature in js
04:19
I'm not a big fan
whats your issue with them?
styled-components uses them extensively and it's just.. bleh
I think it's "clever" programming
(well i hate styled components for a different reason. I think css should be in different files)
i just think this is pretty cool. github.com/ruimarinho/sql-tag
04:24
I think the separation between markup/style/behavior is really just a traditional attempt at proper abstraction layers
I think you can achieve abstraction properly in a different way these days
I think componentization solves a lot of those problems
yes that is mostly true, but i just think css in jsx/markup is really ugly to look at and confusing. 9/10 i don't care about styling when looking at jsx/a component.
I agree. But I also don't care about a lot of other details when looking at my element tree
I'm spared those details by moving them to their own components
I think you can make that work with css/styling too
I just don't see the advantage of thing`` over thing(``)
I think the main advantage is the interpolation
I hate the syntax but the idea is not a bad one
The function can treat the input string -- and each of its interpolated variables -- however it wants
^^
04:28
I don't think I know what it does that you can't do with a different function
Ehh you could say the same about any syntactic sugar
Which I would agree that this is
Sure, but if we agree that the syntax is gross :P
But so is most syntax so
Haha agreed
syntactic salt?
I like it
04:29
syntactic spice
fair enough, i just think the idea is really cool and defiantly useful
I think I would appreciate it more if they made it clearer that it is, in fact, a way of calling a function
Imagine a js beginner sees a tagged template in some code, they would be SO lost
maybe make it in the function deceleration? like a new keyword
At least if they saw a generator function they would still understand its general purpose
tagged function name(string, ...templates){

}
04:32
Yeah something like that would be agreeable I think
And a way of calling it
maybe if you splat a template string it becomes an array
tag(...`${something}`)
I've gotta go. Keep up this discussion and send a proposal to tc39
@phenomnomnominal thats interesting
cya forrest o/
 
1 hour later…
05:54
can I ask question about Datatables here?
 
1 hour later…
07:22
Having an issue flipping my canvas vertically
So I want to draw a better version of my crappy graphing api
and itd be 10x easier drawing it without worrying about flipping my variables
So I tried this:
@MisterSirCode Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
function flipContents() {
	let pastCanvas = ctx.canvas;
	ctx.clearRect(0, 0, cvs.width, cvs.height);
	ctx.save();
	ctx.scale(1, -1);
	ctx.drawImage(pastCanvas, 0, -pastCanvas.height);
	ctx.restore();
}
The original code didnt use the let pastCanvas, and simply "copied and pasted" the entire canvas over itself, which was really annoying, so Im trying to "save" the past canvas into a variable
that obviously isny working
Im utterly out of ideas
I know I could solve this by just using a background
like a white background, but the format I need this in, it cant HAVE a background
user10014185
08:02
need help with
user10014185
0
Q: Facing issue with bar chart png image using canvas on Node.js

Light YagamiI am new to node.js and chart.js library . Currently I am trying to make a Bar graph in a png image by using Chart.js on node. I am able to make bar chart on node but the image quality is not good and label on axis are too much blur. Note: when I make chart on browser using same chart.js confi...

09:29
one question regarding static, so eqjs book asks to write a set implementation, i used obj to store elements to be added to the set, is this ok and is this correct how to use static
class Group {
	constructor () {
		this.obj = {};
	}
	has (x) {
		return (this.obj.hasOwnProperty(x));
	}
	add (x) {
		if (!this.obj.hasOwnProperty(x)) {
			this.obj[x] = 1;
		}
	}
	delete (x) {
		if (this.obj.hasOwnProperty(x)) {
			delete this.obj[x];
		}
	}
  	static from (iterable) {
      	let grp = new Group();
  		for (let elem of iterable) {
  			grp.add(elem);
  		}
      	return grp;
  	}
}


let group = Group.from([10, 20]);
console.log(group.has(10));
// → true
console.log(group.has(30));
@jeea yes, that is a perfect usage here, I think. It's called a factory method. In a lot of cases, you want to make the constructor private, so you can't call it from the outside but I can't remember off the top of my head if that's possible in JS yet. There was a proposal for sure, not sure if it's in yet and implemented in the engines.
 
3 hours later…
13:02
const scaleNames = {
  c: 'Celsius',
  f: 'Fahrenheit'
};

function toCelsius(fahrenheit) {
  return (fahrenheit - 32) * 5 / 9;
}

function toFahrenheit(celsius) {
  return (celsius * 9 / 5) + 32;
}

function tryConvert(temperature, convert) {
  const input = parseFloat(temperature);
  if (Number.isNaN(input)) {
    return '';
  }
  const output = convert(input);
  const rounded = Math.round(output * 1000) / 1000;
  return rounded.toString();
}

function BoilingVerdict(props) {
  if (props.celsius >= 100) {
The above code is from react JS documentation for lifecycle state uplift concepts
function toFaren(celsius){
  return (celsius / 5) * 9 + 32;
}

function toCelsius(faren){
    return (faren - 32) * 5 / 9;
}

class ConvertTemperature extends React.Component{
  constructor(props){
    super(props);
    this.handleCelsius = this.handleCelsius.bind(this);
    this.handleFaren = this.handleFaren.bind(this);
    this.state = {tempC: "", tempF: ""};
  }

  handleCelsius(e){
    const celsius =  e.target.value;
    const farenResult = toFaren(celsius);
    this.setState({tempC: celsius, tempF: farenResult});
the above is a code written by me which gives the same output as react documentation...
Is my code suffice to call it as a react js component or not?
Please clarify
Hello, I have an HTML related question, with a bit of JS, would it be okay asking it here or that's a no-go?
@ZackRoberto Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
@ZackRoberto why dont you try?
Does anyone know the syntax to check resourceState in NodeJS? I'm following a YouTube tutorial by Academind on "Firebase Cloud Functions - resize images after upload", but the code there seems outdated
13:08
Worth a try I guess. So I'm trying to make the slider in this Codepen horizontal, in an attempt to reveal the image from top to bottom, instead of diagonally but I'm running into a plenty of issues each time I try to change something, haha
https://codepen.io/gibinealias/pen/eVvpGq
Some enlightenment would be much appreciated
Hi, @PrashinJeevaganth try to use nodejs Hooks / middleware for manipulate your file i think
@Kijacode Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
@Kijacode Does that work for objects in google cloud storage? Here is the code used in the tutorial paste.ofcode.org/bx7SFEbzLJijTyGa4xekar
const scaleNames = {
  c: 'Celsius',
  f: 'Fahrenheit'
};

function toCelsius(fahrenheit) {
  return (fahrenheit - 32) * 5 / 9;
}

function toFahrenheit(celsius) {
  return (celsius * 9 / 5) + 32;
}

function tryConvert(temperature, convert) {
  const input = parseFloat(temperature);
  if (Number.isNaN(input)) {
    return '';
  }
  const output = convert(input);
  const rounded = Math.round(output * 1000) / 1000;
  return rounded.toString();
}

function BoilingVerdict(props) {
  if (props.celsius >= 100) {
 
3 hours later…
16:13
wow the last like 7 hours are just questions with no answers
JS Chat lookin kinda dead today
16:59
Damn text measurements
I can get text height now, but the width is differed from the canvas one ever so slightly
but its more rounded out with the JS one...
hmmmm
I dont get why text height was never implemented
its kinda stupid at this point
Do you have a minute? Can somebody tell why this function makes the console.log run thrice?
@Drax Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
@Drax Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
Hit up arrow on your keyboard. Tap Ctrl+K and enter
function randomizeCities() {

            const Array = ['tokyo', 'chicago', 'new york'];
            const randomizeArray = Array[Math.floor(Math.random() * Array.length)];
            console.log(randomizeArray);
        }
17:06
:3
Wheres your whole code
@Drax that should only run once, you must be calling it 3 times
I thought itd be a feedback loop, but no, so wheres the whole code, I wanna see if youve written the function elsewhere
||> function randomizeCities() {

            const Array = ['tokyo', 'chicago', 'new york'];
            const randomizeArray = Array[Math.floor(Math.random() * Array.length)];
            console.log(randomizeArray);
        }
       randomizeCities()
@JBis undefined Logged: "tokyo"
see, one log
17:08
^
also... dont use console.log. Use return
Okay, thanks a lot. Then I'm probably calling the function somewhere else. I'm calling the function using speech recoginition, though....
Use return randomizeArray;
Thatll make sure if you run it multiple times, youll always get the value back
to each seperate reference
||> const Array = ['tokyo', 'chicago', 'new york']; const ranArray = Array[Math.floor(Math.random() * Array.length)];
@MisterSirCode "SyntaxError: Unexpected token 'const'" Logged: ``
Bruh did you not implement const...
don't use return, i got fix it
return fucks it up
17:10
:3
@MisterSirCode undefined Logged: ``
So how are you supposed to return values
without console.log :I
Awesome, thanks. I got some new clues now...got to do some investigating now.. :)
Drax
Make sure you use an editor... with syntax highlighting... and Ctrl+F so you can find stuff
@MisterSirCode give him a second, lets see if he can figure it out
17:11
(Visual Studio Code, Codepen, Repl, Etc)
@MisterSirCode if you are trying to help someone, only give relevant suggestions. Otherwise you may confuse them.
¯\_(ツ)_/¯
thanks for the hints, guys. I found it :) I had a for loop somewhere else in my code.
@MisterSirCode what?
Oh i see what you mean, but you worded it like they're interchangable. Next time you should say "don't forget to return the value" because logging and returning from functions are not close in proximity
17:27
thanks for advice :)
*the
So I'm trying to make the slider in this Codepen horizontal, in an attempt to reveal the image from top to bottom, instead of diagonally but I'm running into a plenty of issues each time I try to change something. Any chance anyone can help? Thanks in advance :)
https://codepen.io/bradtraversy/pen/NaKxdP
17:48
@ZackRoberto the js there isn't super complicated. just a bit of math. What have you tried?
In all honesty everything but I cannot seem to be able to put the top image on the top half instead of the left half. The solution is definitely not fully hiding in the JS part, so I'm hoping it's okay posting the question here
18:15
alright lets take a look
i would start from scratch
 
5 hours later…
23:33
if its sign in and sign up then why isn't it login and logup?
asking the real questions
You make a very good point
Comes from the ancient Roman custom for going at parties. Typically they start before sundown - guests would walk through the door and sign their name above the door frame. So, you sign up. After the start of the party, no more guests would be allowed in to prevent overcrowding. However, guests that were there already could come and go and would point out that their signature was inside to be allowed entry.
I just made all of this up, by the way.
bs
That's what I thought
:D
I like it though
23:51
Slightly more seriously - there is an ancient Roman connection to software that I hadn't realised for a VERY LONG TIME! Most likely because I'm dumb but here it goes - the software for writing CDs is called "Nero burning ROM". OK, so burn=write for CDs, and ROM=read only memory. So I never realised it was referencing the actual emperor Nero who allegedly set fire to Rome back in the day.
It's not like it's subtle, either. Here is the logo for the software:
When I saw the icon, I thought it was a CD on fire...
@VLAZ hehe
thoughts on this? I'm using it and really liking it
but i don't think the models are really models there

« first day (3493 days earlier)      last day (1680 days later) »