Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

work on labelling fix for PolarAreaChart #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions micropolar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
micropolar = {version: '0.1.0'};
micropolar = {version: '0.1.0'};
micropolar.chart = {};

micropolar.chart.RadialAxis = function module() {
Expand Down Expand Up @@ -325,7 +325,7 @@ micropolar.chart.PolarAreaChart = function module() {
var h = radialScale(d[1]);
var baseW = Math.tan(triangleAngle) * h;
return 'M'+[[0, 0], [h, baseW], [h, -baseW]].join('L')+'Z' },
transform: function(d, i){ return 'rotate('+ (axisConfig.originTheta - 90 + (angularScale(i))) +')'}
transform: function(d, i){ return 'rotate('+ (axisConfig.originTheta + (angularScale(i))) +')'}
// transform: function(d, i){ return 'rotate('+ (axisConfig.originTheta - 90 + (angularScale(d[0]))) +')'}
})

Expand Down
4 changes: 4 additions & 0 deletions src/area_chart.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ micropolar.AreaChart = function module() {
var h = config.radialScale(d[1]);
var baseW = Math.tan(triangleAngle) * h;
return 'M'+[[0, 0], [h, baseW], [h, -baseW]].join('L')+'Z' },
<<<<<<< HEAD:src/polar_area_chart.js
transform: function(d, i){ return 'rotate('+ (axisConfig.originTheta + (angularScale(i))) +')'}
=======
transform: function(d, i){ return 'rotate('+ (config.axisConfig.originTheta - 90 + (config.angularScale(i))) +')'}
>>>>>>> upstream/master:src/area_chart.js
// transform: function(d, i){ return 'rotate('+ (axisConfig.originTheta - 90 + (angularScale(d[0]))) +')'}
})
.style(markStyle);
Expand Down
60 changes: 60 additions & 0 deletions src/polar_area_stacked_chart.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
micropolar.chart.PolarAreaStackedChart = function module() {
var config = {
dotRadius: 5,
axis: null,
containerSelector: 'body'
};
var dispatch = d3.dispatch('hover');

function exports(_datum) {
var _datumStacked = d3.nest().key(function (d) { return d[3] }).entries(_datum);
_datumStacked.forEach(function (d) {
d.values.map(function (val) {
val.x = val[0];
val.y = +val[1];
return val;
})
});

var stacked = d3.layout.stack();

stacked(_datumStacked);

d3.select(config.containerSelector)
.datum(_datumStacked)
.each(function (_data, _index) {

config.axis.config({ containerSelector: this })
config.axis(_datum);

radialScale = config.axis.radialScale();
angularScale = config.axis.angularScale();
axisConfig = config.axis.config();

var triangleAngle = (360 / data.length) * Math.PI / 180 / 2;

var geometryGroup = d3.select(this).select('svg g.geometry');

var geometry = geometryGroup.selectAll('path.mark')
.data(_data);
geometry.enter().append('path').attr({ 'class': 'mark' });
geometry.attr({
d: function (d, i) {
var h = radialScale(d[1]);
var baseW = Math.tan(triangleAngle) * h;
return 'M' + [[0, 0], [h, baseW], [h, -baseW]].join('L') + 'Z'
},
transform: function (d, i) { return 'rotate(' + (axisConfig.originTheta + (angularScale(i))) + ')' }
// transform: function(d, i){ return 'rotate('+ (axisConfig.originTheta - 90 + (angularScale(d[0]))) +')'}
})

});
}
exports.config = function (_x) {
if (!arguments.length) return config;
micropolar._override(_x, config);
return this;
};
d3.rebind(exports, dispatch, 'on');
return exports;
}
61 changes: 61 additions & 0 deletions web.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<configuration>
<system.webServer>

<handlers>
<!-- indicates that the app.js file is a node.js application to be handled by the iisnode module -->
<add name="iisnode" path="server.js" verb="*" modules="iisnode" />
</handlers>

<rewrite>
<rules>
<!-- Don't interfere with requests for node-inspector debugging -->
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^server.js\/debug[\/]?" />
</rule>

<!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
<rule name="StaticContent">
<action type="Rewrite" url="public{REQUEST_URI}" />
</rule>

<!-- All other URLs are mapped to the Node.js application entry point -->
<rule name="DynamicContent">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True" />
</conditions>
<action type="Rewrite" url="server.js" />
</rule>
</rules>
</rewrite>

<!-- You can control how Node is hosted within IIS using the following options -->
<!--<iisnode
node_env="%node_env%"
nodeProcessCountPerApplication="1"
maxConcurrentRequestsPerProcess="1024"
maxNamedPipeConnectionRetry="3"
namedPipeConnectionRetryDelay="2000"
maxNamedPipeConnectionPoolSize="512"
maxNamedPipePooledConnectionAge="30000"
asyncCompletionThreadCount="0"
initialRequestBufferSize="4096"
maxRequestBufferSize="65536"
watchedFiles="*.js"
uncFileChangesPollingInterval="5000"
gracefulShutdownTimeout="60000"
loggingEnabled="true"
logDirectoryNameSuffix="logs"
debuggingEnabled="true"
debuggerPortRange="5058-6058"
debuggerPathSegment="debug"
maxLogFileSizeInKB="128"
appendToExistingLog="false"
logFileFlushInterval="5000"
devErrorsEnabled="true"
flushResponse="false"
enableXFF="false"
promoteServerVars=""
/>-->

</system.webServer>
</configuration>