d3 getting invert value of Band Scales : <p>i am writing a Gantt Chart using d3</p>

<p>i have xScale with Time Scale(Time)</p>

<pre><code>this.xScale = d3.scaleTime()
            .domain([this.startDate,this.endDate])
            .range([0,this.getWidth()]);
</code></pre>

<p>and yScale as Band Scale (Resources)</p>

<pre><code>this.yScale = d3.scaleBand()
        .domain(resources.map(function(res){
            return res.res_num;
        }))
        .rangeRound([0,this.getHeight()])
        .paddingInner(.3)
</code></pre>

<p>Problem is i need to drag and drop the task( SVG Rect) from one resource to another resources</p>

<p>When i drag i am using the transfrom so its moving on the SVG</p>

<pre><code>_onDrag : function(d)
    {
        var x = d3.event.dx+d3.event.x;
        var y = d3.event.dy+d3.event.y;
        d3.select(this).raise().attr("transform","translate(" + [x,y] + ")");
    },
</code></pre>

<p>But on drop i have to handle the logic as below:</p>

<ol>
<li>the rect should not be in between the resources, so need to transform to any band based on d3.event.y

<ol start="2">
<li>in xAxis the time scale which has the invert but the yScale not have this. How to do this? </li>
</ol></li>
</ol>
