I searched online about the problem of using d3.js SVG under IE8, and I find an ideal method is using R2D3, and I tried to do like that, but it still doesn't work yet.
I am not sure what I have tried is right, do I only need to import the library like that?
<html>
<head>
<title>R2D3 101</title>
<!--[if lte IE 8]><script src="r2d3.js" charset="utf-8"></script><![endif]-->
<!--[if gte IE 9]><!-->
<script src="d3.js"></script>
<!--<![endif]-->
</head>
<body>
<h1>Hello, world!</h1>
</body>
</html>
And other things don't need to change? If you are interested, I can show you a simple demo about my treemap function.
http://jsfiddle.net/srvikram13/cR35x/9/
At first, I am thinking about if it is the problem of the limitations using Transforms as mentioned in the github: https://github.com/mhemesath/r2d3/
But the thing is, I really write the function as the GOOD one:
// BAD
circles.transform('translate(20)');
// GOOD
circles.transform('translate(20,0)');
Related
I've set up a brand new site on 2.6.5.
As per my usual practice, I set up a head chunk. However I noticed it was not saving. On experimentation I see that it is not saving self-closing tags.
For example
<head>
<title>My test page</title>
</head>
Saves fine.
<head>
<base href="[[++site_url]]">
<title>My test page</title>
</head>
Will not save.
There are no errors. I have manually cleared the cache.
I have also tried:
<base href="[[++site_url]]" />
and I have tried using both a mark up plugin (Ace) and without.
Would anyone know what's going on here?
Usually it is because of mod_security. Kindly check with hosting support.
Another resource to consult, it is for MODX Revolution but server side situation would be similar and gives you clues: https://docs.modx.com/revolution/2.x/getting-started/installation/basic-installation/installation-on-a-server-running-modsecurity
I am unable to get MathJax to change the font that it is using to render formulas written in AsciiMath. I have read the answers to similar questions here at StackOverflow and other places on the web:
Styling MathJax
Changing mathjax's font size
MathJax font matching and pairing
Can MathJax use font xxxx?
Here is an entire HTML5 document that I am using as a test case:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>MathJax Font</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"CommonHTML" : { preferredFont:"Asana Math" }
});
</script>
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=AM_CHTML"></script>
</head>
<body>
<p>`v = pi r^2`</p>
</body>
</html>
What am I doing wrong? Please help me change the font for MathJax.
I found this at docs.mathjax.org/en/latest/output.html
The CommonHTML output processor produces high-quality output in all modern browsers, with results that are consistent across browsers and operating systems. This is MathJax’s primary output mode since MathJax v2.6. Its major advantage is its quality, consistency, and speed as well as support for server-side generation. Its browser supports starts with IE9 and equivalent browsers and it degrades gracefully on older browsers. The CommonHTML output uses web-based fonts so that users don’t have to have math fonts installed on their computers. It currently only supports MathJax’s default TeX fonts.
I had to change my file to use the HTML-CSS output processor instead of the CommonHTML output processor. After the change my test file now looks like this:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>MathJax Font</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"HTML-CSS" : {
availableFonts : ["STIX"],
preferredFont : "STIX",
webFont : "STIX-Web",
imageFont : null
}
});
</script>
<script type="text/javascript"
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=AM_HTMLorMML"></script>
</head>
<body>
<p>`v = pi r^2`</p>
</body>
</html>
I'm trying to build a simple example on Cloud 9 using node.js and D3, but having some issues rendering the chart.
I have a simple view in a chart.ejs file and have attempted to do an include of the d3.v3.js and d3.layout.js files. However, I keep getting Uncaught Syntax Error: Unexpected token < when the d3 include files are reached.
So a couple of questions:
Has anyone been able to use D3 with EJS? I've seen some Jade examples, but not EJS.
Is using the <script> tag the appropriate way to use D3 with EJS rendering?
Any good examples out there using D3 and node.js?
Would appreciate any thoughts / comments?
Disclaimer: I'm relatively new to node.js and D3, so I may need some basic direction.
EDIT: here's the chart.ejs code. It has something to do with the script include. When I try to include locally like below, it throws the unexpected token error. But when I refer to the include from a download location, it seems to work. It may be a C9 thing, not sure though. Curious if someone else has run across this in C9:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3 Page Template</title>
<script type="text/javascript" src="d3.v3.js"></script>
</head>
<body>
<script type="text/javascript">
// Your beautiful D3 code will go here
</script>
</body>
</html>
I am new to meteor and I am trying to do multi-page application where http://www.mydomain.com/page1 will result a totally different page from http://www.mydomain.com/page2.
By totally different I mean that I don't want the page to be rendered by the client.
I tried to use meteor-router but What I got is something like:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/myapp.css?9297ad4aa173c4e0c19aebd27c62a5c43242bb93">
<script type="text/javascript">
__meteor_runtime_config__ = {"ROOT_URL":"http://localhost:3000","serverId":"iMp4kgzzeqDtktJoY"};
</script>
<script type="text/javascript" src="/packages/underscore/underscore.js?6d71e6711255f43c0de8090f2c8b9f60534a699b"></script>
<script type="text/javascript" src="/packages/meteor/client_environment.js?07a7cfbe7a2389cf9855c7db833f12202a656c6b"></script>
<script type="text/javascript" src="/packages/meteor/helpers.js?2968aa157e0a16667da224b8aa48edb17fbccf7c"></script>
...
...MANY MANY MANY SCRIPTS.... ?!?
...
...
<script type="text/javascript" src="/myapp.js?2866dcdb5c828b129cdd3b2498a4bf65da9ea43f"></script>
<title>myapp</title>
</head>
<body>
</body>
</html>
And this is not what I want. I want page1 route will return me:
<!DOCTYPE html>
<html>
<head>
My meta tags
</head>
<body>
page1
</body>
</html>
And I want page2 to return different meta tags with different content.
In order to be clear, lets assume that my clients sometime doesn't have javascript. I don't asking about whether meteor is the right framework! I am asking only if can I do this with meteor.
Meteor works a bit different compared to the traditional LAMP stack. Basically it works by patching out the DOM to only where the changes are needed as opposed to re-downloading the whole web page. It makes for a very satisfying end user experience on modern web browsers.
To use meteor router you need to find a spot that you want to patch out with new data for different pages with {{renderPage}}. You can use something like
<head>
<title>xx</title>
</head>
<body>
{{renderPage}}
</body>
<template name="page1">
<h2>Hello!</h2>
</template>
<template name="page2">
<h2>Ola!</h2>
</template>
Now you need to define a router in your client side javascript:
Meteor.Router.add({
'/page1': 'page1',
'/page2': 'page2'
});
So if you load /page1 you would see Hello! and if you load /page2 you would see Ola! as defined in the <template name="page2">..</template>
With the meta tags you need to use javascript to create them. With something like
$('head').append("<meta...");
Again this depends on your preference, personally I find these type of apps load ridiculously fast between web pages as compared to other 'thin' based websites. (Have a look at meteor.com to see how fast you can swap between the pages). The browser does need javascript, however.
Of note is in production mode there will only be 1 script tag.
I am searching for an IE6 code which will redirect users from our brand new web page to an older version.
for example something along these lines
<!--[if lte IE6]>
<a href="http://etterengineering.com">
<![endif]-->
Thank you!
<!--[if lte IE 6]>
<meta http-equiv="refresh" content="0;url=http://example.com/" />
<![endif]-->
Put this in the head of your page and change the URl to the correct one. This will work even if the user has disabled JS.
Note that meta refresh is discouraged due to some associated drawbacks, but for your purposes should be good enough.
The alternative is to return HTTP 302 for IE6 user agent.
Try this:
<!--[if lte IE6]>
<script type="text/javascript">
window.location.href = "http://etterengineering.com";
</script>
<![endif]-->